Hi,
I have this simple data file:
data.frame(stringsAsFactors=FALSE,
URN = c(1042020172320, 1042020172453, 1042020172583),
DealerCode = c("DE2331", "DE2289", "DE1672"),
InterviewDate = c("2019-01-04 19:43:00", "2019-01-09 11:33:00",
"2019-01-07 16:18:00"),
A2 = c(8, 8, 10),
F1 = c(5, 3, 6),
F2 = c(7, 9, 10),
F3 = c(8, 4, 10),
F4 = c(6, 4, 10),
F5 = c(5, 2, 7),
F6 = c(5, 2, 10),
FComm = c("aaa", "bbb", "ccc"),
AlfaModel = c("x", "y", "z")
)
I am using 2 functions below to multiply all numeric values by 10:
Option 1
result <- data.frame %>%
mutate_if(is.numeric, ~ .x * 10)
and:
result <- data.frame %>%
mutate_at(vars(starts_with('A')), ~ .x * 10) %>%
mutate_at(vars(starts_with('F')), ~ .x * 10)
but they don't work
Also, the key thing is keeping FComm and AlfaModel unchanged.
How can I do that?