[R] Odp: Operator > and <
petr.pikal at precheza.cz
Wed Jul 25 14:50:36 CEST 2007
you definitely shall make a quick glance to some documentation which comes
with R e.g. R intro manual. Or look at CRAN where is quite impressive
amount of literature from basic stuff to advanced papers.
To your question:
r-help-bounces at stat.math.ethz.ch napsal dne 25.07.2007 14:23:58:
> I'am new to the R world and have a lot of question but the first is :
> deal with <> opertor in table objects? (Or how to deal with <> in
> general...) I explain my problem.
> I read a file with the read.table expression. I then obtain a matrix. I
> the first line for example with the commande data[,1]. Then I would like
You did not select line but column.
data[,1] > 2
will give you logical vector which you can use for selection of rows from
data[data[,1] > 2,]
> select only the element in this line that are greater than 2. Is there
> elegant way to achieve that ?
> Thanks by advance...
> View this message in context:
> Sent from the R help mailing list archive at Nabble.com.
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help