I am using the package dplyr with R (same problem applies to plyr, too). When I call source("dply_problem.R")
to the following code
library("dplyr")
df <- data.frame("A" = 1:6,
"B" = 7:12)
mutate(df, C = A + B)
the column "C" does not get added to df
. However, when I call mutate(df, C = A + B)
from the shell, the column "C" does get created. Could you give me a hint why this is happening?
mutate
to "df"? – Mammoth