November 2018
Beginner to intermediate
420 pages
10h 4m
English
R contains inbuilt functions for reading data. The most commonly used format is CSV, that is, CSV files. There are multiple commands to read CSV files. A few are shown as follows. In order to conduct our tests, we will use the mtcars dataset in R.
First, we are going to create a copy of the dataset into a new variable called car_data:
car_data <- mtcars
To view the top few rows of the mtcars dataset, we can use the head command. This is often very useful in getting a quick glimpse of the data we will be working with:
head(car_data)
The following is the output of the preceding code:

Create the CSV file:
write.csv(car_data,"car_data.csv") ...
Read now
Unlock full access