[R] sink() not working as expected [RESOLVED]

Rich Shepard r@hep@rd @end|ng |rom @pp|-eco@y@@com
Wed Nov 3 21:44:34 CET 2021


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



More information about the R-help mailing list