Week 2: Plots, tapply and data frames



examples of plots

R has powerful graphical capabilities, which can be easy to use: R code or the video of some example plots


introduction/definitions

We define factors, levels, and data frames, using the CO2 (Carbon Dioxide Uptake in Grass Plants) built-in R example:
R code or the video about these definitions


introduction to tapply

We continue to use the CO2 data set, and we introduce the tapply function:
R code or the video about tapply


more about tapply

We continue to explore tapply using the iris data; we group a vector of numerical values to create a factor:
R code or the video with iris example


using tapply with dice

We give an example with dice, using the tapply function:
R code or the video with dice example


using tapply with geyser data

We give an example with the geyser data, using the tapply function; again we turn a vector of integers into a factor, using grouping:
R code or the video with geyser data


using tapply with the length function, and with mtcars data

We use the mtcars data to showcase the use of the length function in the tapply (just like the table function):
R code or the video with mtcars data


using tapply with the na.rm=T parameter

We use the airquality data set to deal with NA values in the tapply:
R code or the video with airquality data


exploring data from the Columbia River Estuary

The Center for Coastal Margin Observation and Predication makes a great deal of data publicly available; we use it to explore importing and exporting data:

You will need to download the csv file and save it in your directory.

R code or the video with CMOP data


further exploring the data from the Columbia River Estuary

We continue to explore CMOP's data, including a brief explore of finding and dealing with an outlier in a large data set:
R code or the another video with CMOP data