On Wed, 3 Nov 2021, Rui Barradas wrote:

You do not assign the pipe output, so put the print statement as the last
instruction of the pipe. The following works.

# file: rhelp.R
library(dplyr)

mtcars %>%
 select(mpg, cyl, disp, hp, am) %>%
 mutate(
   sampdt = c("automatic", "manual")[am + 1L]
 ) %>%
 print()

Rui,

Thank you very much. It works here, too.

Much appreciated,

Rich

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to