Tibble doesn't return a new column

Hi everyone. First time here. I'm a beginner with R. I was doing a course exercise, where you create a new column for penguins' body mass in kgs from the already existing body_mass_g column. The code I typed in, following the video, was:

penguins %>% 
  mutate(body_mass_kg=body_mass_g/1000)

In the course video, the tibble automatically returns the new column next to the year-column. However, for me, it just looks like this:

What am I doing wrong? Why doesn't the tibble show the new body_mass_kg column?

You need to save the change if you want the new column to persist, e.g.:

penguins <- penguins %>%
mutate(body_mass_kg=body_mass_g/1000)
2 Likes

This was it. Thank you so much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.