This describes the basic plots for exploratory data analysis. It largely discusses univariate plots such as:

Histograms Density Plots Box And Whisker Plots Barplots

As always the input data is an endoscopic dataset:

 Midazolam<-sample(1:10, 100, replace=TRUE)
 Fentanyl<-sample(1:100, 100, replace=TRUE)
 Age<-sample(1:100, 100, replace=TRUE)
 TimeSpentDoingEndoscopy<-sample(1:50, 100, replace=TRUE)
SurgeryorNoSurgery<-sample(c("Surgery","NoSurgery"), 100, replace = TRUE)


hist() is the function to use.

#If you want to specify the break sizes you just need to add the 'breaks' parameter:

Density Plots

These can also be useful:


Box And Whisker Plots

boxplot(TimeSpentDoingEndoscopy ~ SurgeryorNoSurgery  , data = EndoCr,
        xlab = "Surgery or not", ylab = "Time Spent Doing Endoscopy",
        main = "Time spent doign index endoscopy vs need to suergy as the outcome"

These are meant as the briefest way to visualise univariate data. There are prettier grpahs using the ggplot package and the layout of graphs can also be very nicely controlled with the lattice package.

More simple plots can be found here:

and for simple plots with ggplots (see the relevant page on this site too) look at