I have two data frames that look like this:
df1 <- data.frame(date = c("01.01.", "02.01.", "03.01.", "04.01.", "05.01."),
A = c(102, 75, 99, 175, 60),
B = c(94, 37, 140, 63, 87),
C = c(55, 23, 90, 102, 107))
df2 <- data.frame(ID = c("A", "B", "C"),
dummy = c(1, 0, 1))
I'm now trying to create a df3 using the select() function in dplyr. The result should only include those who have a dummy == 1, meaning that df3 would only have column A and C remaining. However, since the dummy is found in a separate file, and can't really be merged into the first one, I am unsure how to do this.
Thanks!