Let's say I have the following data frames below. How would one use "Partial_Match" of df2 to replace "CS" of df1 with "Name" from df2? What I am looking for is an output that looks like df3. Thanks.
old <- c("CS1.1.length", "CS1.7.length", "CS1.10.length", "CS1.12.length", "CS2.4.length", "CS2.6.length", "CS2.9.length", "CS2.11.length")
new <- c("Bob", "Alex", "Gary", "Taylor", "Tom", "John", "Pat", "Mary")
partial_match <- c("CS1.1", "CS1.7", "CS1.10", "CS1.12", "CS2.4", "CS2.6", "CS2.9", "CS2.ll")
df1 <- data.frame(CS = old, Num = sample(50,8))
df2 <- data.frame(Partial_Match = partial_match, Name = new)
df3 <- data.frame(df2[2],df1[2])