Re: [R] removing rows from matrix

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Fri, 02 May 2008 08:08:23 -0300

Try:

x <- matrix(sample(10:1100, 100), 10)
x[!apply(x < 50 | x > 1000, 1, any),]

On Fri, May 2, 2008 at 6:48 AM, Monna Nygård <monnire_at_hotmail.com> wrote:

>
> Hi, I have a problem regarding matrix handeling. I am working with a
> serie of matrixes containing several columns. Now I would like to delete
> those rows of the matrixes,that in one of the columns contain values less
> than 50 or greater than 1000. How would this be possible, I have tried to
> create a simple function for this, but I just don't seem to get it
> right.Thank you so much for your help, Monna
> _________________________________________________________________
> [[elided Hotmail spam]]
>
> PLink
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]


______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Received on Fri 02 May 2008 - 11:11:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 02 May 2008 - 11:30:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive