Displaying 3 results from an estimated 3 matches for "rowmatch".
Did you mean:
nomatch
2011 Jul 05
1
if else loop
Dear R help
I was hoping you might be able to show me how to write a loop function take
would ccomplish this task.
library(prob)
{
a <- sample ( 1:20, 100, replace=T)
b<-sample(5:24,100,replace=T)
}
dd <- data.frame(a,b)
dd
# code piece I am looking for
if(subset(dd,c(1,23,ordered=F))is found))( print subset)
else( continue evaluating subsets)
subset(dd,isin(dd,c(1,23), ordered =
2011 Apr 22
2
Matching a vector with a matrix row
Hello I am trying to compare a vector with a Matrix's rows.The vector has
the same length as the number of columns of the matrix, and I would like to
find the row numbers where the matrix's row us the same as the given vector.
What I am doing at the moment is using apply as follows:
apply(Matrix,1,function(x)all(x%in%LHS))
but this isn't too fast actually. I would like to know if
2005 Aug 15
4
Vector comparison to matrix
I am looking for a fast way to count the number of rows in a matrix are
identical to a pattern vector. For example, if I am interested in counting
the number of row vectors in a matrix that are identical to (1,2,3) what
would I do? I have tried the identical statement in a loop but this is far
too slow. I have a very large matrix and need to avoid loops at all costs.
Thanks for any help.