I am having trouble mutating a subset of rows in dplyr
. I am using the chaining command: %>%
to say:
data <- data %>%
filter(ColA == "ABC") %>%
mutate(ColB = "XXXX")
This works fine but the problems is that I want to be able to select the entire original table and see the mutate applied to only the subset of data I had specified. My problem is that when I view data after this I only see the subset of data
and its updated ColB
information.
I would also like to know how to do this using data.table
.
Thanks.