I have two data frames. The first looks like this:
value <- seq(1, 100, length.out=20) df1 <- data.frame(id=as.character(1:20), valu
Just adding another approach to the existing list of excellent answers:
> library(dplyr) > library(qdapTools) > mutate(df2, v2 = id %l% df1) # id v2 #1 1 1.000000 #2 2 6.210526 #3 3 11.421053 #4 4 16.631579 #5 5 21.842105 #6 21 NA #7 22 NA #8 23 NA