I want to make a vector of sums where sum would be a number of 1s in one column in one df if another column from the same df has values equal or greater with a column from a different df in which I actually want to write vector.
I have something like this
DF1$A <- c( 0.12 , 0.29, 0.36, 0.55)
DF2
x <- c(0,0,1,0,1,0,1,0,0,1)
y <- c(0.11, 0.55, 0.23,0.33,0.59,0.66,0.88,0.11,0.05,0.90)
I want to make a vector DF1$B
DF1B<- sum(DF2$Y >= DF1$A & DF2$X == 1)
Problem is that I get a vector of one value and I want every value of the vector to be different based on a condition that is also a vector.
Also, I am getting this massage l
longer object length is not a multiple of shorter object length.