problem in mutate

penguins %>%
mutate(body_mass_kg=body_mass_g/1000, flipper_lengt_m=flipper_length_mm/1000)

every time I use the mutate function for more than one variable, always the variable after the comma doesn't appear in the Tibble but shows me this message :
# :information_source: 1 more variable: flipper_lengt_m
I don't understand how can I show this new column.
Can someone help me?

The new column is inside your tibble, but is not shown because of stylistic decisions made by the developers. If you assign it to a new data.frame and check its columns, either by str(myTibble) or colnames(myTibble), you will see it.

1 Like

Given the width of you console pane, there is enough room to display body_mass_kg but not enough for flipper_length_m too. It does alert you that flipper_length_m is not shown. This happens more often on my MacBook than the iMac with the 27 inch screen.

If you assign the output to a new data frame, then you can see all of the columns using view() or clicking on the name in the environment pane.

1 Like

Try using the c() function to group all the data in one table instead of creating only one column as it is currently doing.

1 Like

its convenient to look at your table by glimpse() / a function within tidyverse; pillar implements it and its reexported for dplyr also

1 Like

This topic was automatically closed 42 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.