This worksheet guides you in reading a CSV data set into one of R most versatile data structures - the data frame. After completing this worksheet you should have gained some experience in reading CSV files and accessing selected rows, columns or cells of data frames.
During September and October 2014, an ecological field survey has been carried out at Chã das Caldeiras on Fogo island. The survey encompassed 161 plots of 5 meters by 5 meters on which data on agricultural and natural vegetation as well as on animal activity and diversity has been collected. In addition, some information has also been collected in a 10 meter by 10 meter area.
During the following worksheets, selected aspects of this data set are analyzed. Later worksheets will build on previous ones and in the end, you will have performed an actual (and hopefully meaningful) ecological analysis for the Fogo natural park.
For simplicity, we will use only a subset of this data set which encompasses all survey plots but for which the individual species records have been aggregated to richness or total activity values.
Data analysis always starts with reading the data set. So let's do it.
Please download the field survey data subset and write an R script which reads the content of the data into a data frame. Check if everything is ok by looking at the first few lines of the data once the reading has been completed and get a comprehensive summary of the data set using the summary() function.
The R script you have just created will form the basis for the upcoming worksheets, so make sure you save it. For simplicity, please name your script files after the worksheet (i.e. “W02-1.R” in this case).
The following is just a finger exercises and will not directly be used in the upcoming worksheets. So if you want to store it, please make a copy of your script first.
Please perform the following task as a finger exercises on accessing data subsets inside a data frame:
You might have noticed cells with a value of NA. What does NA mean?