Expensive as shown below:
nr <- c(100:199)
dt <- rep("data",100)
x <- data.frame(nr,dt)
y <- c(110:115)
I need to get, with the common numbers between the first column of the data.frame x and the list and
match <- x[x[1] == (lapply(x[1], function(z) which(y %in% z))),]
print(match)
But I have the error:
"Warning message:
In FUN(left, right) :
longer object length is not a multiple of shorter object length"
The expected result should look like this:
110 "data"
111 "data"
112 "data"
113 "data"
114 "data"
115 "data"