R: assign dataframe column values using external vectors
I have a dataframe that looks like this: df <- data.frame(sample = c(1,2,3,4), code = c("D", "B", "A", "B")) I also have two vectors that look like this: code <- c("A", "B", "C") name <- c("Apple", "Bat", "Cat") I know if I wanted to use the vectors to assign a "name" based on a matching… Read More R: assign dataframe column values using external vectors