Skip to content
R for the Rest of Us Logo

R in 3 Months (Spring 2026)

Import Data Again

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.

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

  1. Adjust your read_csv() code so that you import the data again

  2. Use the na argument to tell read_csv() what should be treated as missing in the altitude_mean_meterscolumn

  3. Use the col_types argument to make sure that altitude_mean_meters gets imported as numeric data

  4. Examine 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

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Course Content

144 Lessons