Perform the following steps to read and write data with R:
- To view the built-in datasets of R, type the following command:
> data()
- R will return a list of datasets in a dataset package, and the list comprises the name and description of each dataset.
- To load the dataset iris into an R session, type the following command:
> data(iris)
- The dataset iris is now loaded into the DataFrame format, which is a common
data structure in R to store a data table.
- To view the data type of iris, simply use the class function:
> class(iris)
[1] "data.frame"
- The data.frame console print shows that the iris dataset is in the structure of DataFrame.
- Use the save function to store an object in a file. For example, to save the loaded ...