Essential Programming Concepts in R
This lesson introduces basic programming concepts in the R programming environment. In particular, it teaches how to create, display, and manipulate data sets and data frames -- two of the most important object types in R. In addition, functions will be used to organize code. Next, if statements and loops are presented with many examples. Lastly, the lesson shows how to import and export data in text files.
Objectives
Upon completion of this lesson, you will be able to
Upon completion of this lesson, you will be able to
- create data sets and data frames
- display the content of data sets, arrays, sequences, and data frames
- append data columns to data frames
- control the flow of execution using if, for, and while
- load data from a text file into a data set using read.table
- write data from a data set into an external text file using write.table
- identify missing data
- create simple summary statistics
- specify simple logical queries on data sets using any and which
Required Readings
- Chapter 2 in text book
- R Programming Style Guide
Data Sets