Hi, I have this simple df:
source <- data.frame(
stringsAsFactors = FALSE,
URN = c("21GB01097000",
"21G170101345","21GB00097827"),
QA31 = c("aaa", "bbb", "ccc"),
TMC.Communication = c(0, 1, 0),
QA1 = c(3, 1, 7),
TMC.Paperwork = c(0, 0, 0),
TMC.Other = c(1, 0, 1)
)
I know I can move the most interesting variables first using this:
result <- source %>%
select(URN, TMC.Communication, TMC.Paperwork,
TMC.Other, everything())
but can I replace all variables starting with TMC by something more general? I would like to avoid listing all TMC variables in the select statement...