Thank you Dr. Burns,
I tried that, but I don't think it accomplishes what I intended.
Let me try to explain better.
I have
myMatrix myMatrix2
(8000 by 20) (8000 by 1)
myMatrix2 is the variance across the rows of myMatrix.
I want to subset myMatrix to include only variances under a specific value (
i.e. a value I choose based a cutoff from myMatrix2)
So I want to output a new myMatrix that includes only those variances under
a specific value.
thank you,
On 4/4/06, Patrick Burns <pburns@pburns.seanet.com>
wrote:>
> I think you want something like:
>
> myMatrix2 <- myMatrix[ myMatrix[,1] < myVector, ]
>
> You may find the subscripting section of chapter 1 of
> S Poetry to be useful.
>
> Patrick Burns
> patrick@burns-stat.com
> +44 (0)20 8525 0696
> http://www.burns-stat.com
> (home of S Poetry and "A Guide for the Unwilling S User")
>
> mark salsburg wrote:
>
> >I have two objects, one matrix and one vector.
> >
> >I want to use my vector to subset certain values out of my matrix.
> >
> >For example:
> >
> >I want to tell R, to select out all rows in myMatrix into a new
myMatrix2
> IF
> >that corresponding row is less than a 0.5 in myVector.
> >
> >So:
> >
> >myMatrix = a matrix of 8000 by 20
> >myVector = vector of 8000
> >
> >myMatrix2 = a matrix of < 8000 by 20 (based on selection criteria in
> >myVector)
> >
> >I hope this makes sense..
> >
> > [[alternative HTML version deleted]]
> >
> >______________________________________________
> >R-help@stat.math.ethz.ch mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
> >
> >
> >
> >
>
[[alternative HTML version deleted]]