Import Data Again
This lesson is called Import Data Again, part of the Getting Started With R course. This lesson is called Import Data Again, part of the Getting Started With R course.
Transcript
Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.
Loading transcript...
View code shown in video
library(tidyverse)
coffee_ratings <- read_csv(
"coffee_ratings.csv",
na = c("No rating", "Unknown", "8", "1", "3", "4", "23", "47"),
col_types = cols(total_cup_points = "d", harvest_year = "i")
)
coffee_ratings
Your Turn
Adjust your
read_csv()code so that you import the data againUse the
naargument to tellread_csv()what should be treated as missing in thealtitude_mean_meterscolumnUse the
col_typesargument to make sure thataltitude_mean_metersgets imported as numeric dataExamine your data again to confirm that the changes were made successfully
The code that I created and that you can use to get started is below.
library(tidyverse)
coffee_ratings <- read_csv(
"coffee_ratings.csv",
na = c("No rating", "Unknown", "8", "1", "3", "4", "23", "47"),
col_types = cols(total_cup_points = "d", harvest_year = "i")
)
coffee_ratings
You need to be signed-in to comment on this post. Login.