3.10 Wrap-Up
I hope that’s gotten you enthused about some of the power of R. This chapter covered a lot of code somewhat quickly, but the point was to see that R can do some cool things, not to learn and understand every nuance of programming presented here.
Here’s what’s worth remembering from this chapter:
Load an entire R package into your working session’s memory with library(mypackage)
.
You can use a function from an external package without loading the entire package into memory, using the syntax mypackage::myfunction()
.
Run R code from an external file with source("myfile.R")
.
Combine data frames by column with cbind()
(putting them together side by side) and by row with rbind()
(putting them together one below the other). We’ll cover more sophisticated merging by common columns in later chapters.
names(myobject)
will display an object’s existing names. You can also change the names of one or more items in an R object with names(myobject), such as names(mydataframe) <- c(“Column1”, “Column2”).
NA stands for Not Available and indicates missing data in R.
There are some very elegant ways of importing and visualizing data with R.
Next up: How to import all sorts of data into R.