On Mon, 1 Nov 2021 15:24:47 -0700 (PDT)
Rich Shepard <rshep...@appl-ecosys.com> wrote:

> + mutate(
> + sampdt = make_datetime(year, mon, day, hr, min)
> + )

<...>

> produces the sampdt column, but it, and the timezone, are not present
> in the cor_disc tibble

That's because mutate() doesn't, well, mutate its argument. It _returns_
its changes, but it doesn't save them in the original variable. It's
your responsibility to assign the result somewhere:

cor_disc |> select(...) |> mutate(...) -> cor_disc_mutated

(Idiomatic R makes it hard to accidentally change the value of the
variable passed to a function from inside of that function. Anything
short of environments, reference class objects and/or non-standard
evaluation will not affect the value outside the function call.)

-- 
Best regards,
Ivan

______________________________________________
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