I have 2 objects:
Data frame with three variables:
v1 <- 1:10 v2 <- 11:20 v3 <- 21:30 df <- data.frame(v1,v2,v3)
A numerical vector with three elements:
nv <- c(6,11,28)
I would like to compare the first variable with the first number, the second variable with the second number, etc.
which(df$v1 > nv[1]) which(df$v2 > nv[2]) which(df$v3 > nv[3])
Of course, in fact, there are a lot more variables in my data frame, so manually setting each variable is not an option.
I often encounter such problems. What documentation will I need to read in order to speak freely about it?
source share