Section 13 Read, Write & Save: Example
13.1 data(iris)
This famous (Fisher’s or Anderson’s) iris data set gives the measurements in centimeters of the variables sepal length and width and petal length and width, respectively, for 50 flowers from each of 3 species of iris. The species are Iris setosa, versicolor, and virginica.
Download the Microsoft Excel data file:
iris.xlsx
Open the file in Excel
Save the data as a comma-separated value format or csv file: “iris.csv”.
Go to Rstudio, set the working directory to the folder where the csv file is saved
Read the csv file “iris.csv” and assigned it to a R data.frame object
iris_new
.Save the data as a csv file: “iris_new.csv”
Save the data as an R data object: “iris_new.RData”
Save the complete workspace as an R object:
my_workspace.RData
To find the details on the iris data, check ?iris