Before we start with analyzing any data, we must load it into our R workspace. This can be done directly either by loading an external R object (typical file extensions are
.RData, but it is not limited to these extensions) or an internal R object for a package or a TXT, CSV, or Excel file. This recipe explains the methods that can be used to read data from a table or the
.csv format and/or write similar files into an R session.
We will use an iris dataset for this recipe, which is available with R Base packages. The dataset bears quantified features of the morphologic variation of the three related species of Iris flowers.
Perform the following steps to read and write functions in R: