Thank you everyone for taking the time to reply.
Thanks Martin and Hervé for your solutions.
Now I just need to remember to check for NA match.
--
View this message in context:
http://r.789695.n4.nabble.com/indices-of-mismatch-element-in-two-vector-with-missing-values-tp4710497p4710518.html
Se
How would you return the index where two vectors differs if they may contain
missing (NA) values?
For example:
test1 <- c("1","2",NA);
test2 <- c("1","2","3");
which(test1!=test2) does not return 3!
Thanks in advance.
--
View this message in context:
http://r.789695.n4.nabble.com/indices-of
Dear R users,
I am trying to sum number that exist in another vector up to i, then
increment i and repeat.
Sorry. It's hard to explain but basically I am trying to do the following:
test <- c(1,2,3,4);
test2 <- c(3,5,6,7,2,8,8,4,4);
test3 <- c(10,20,30,40);
tmp <- 0;
for (i in 1:length(test)){
tmp
3 matches
Mail list logo