[R] extract with condition
Stephen D. Weigand
weigand.stephen at charter.net
Thu May 19 05:35:07 CEST 2005
On May 18, 2005, at 5:11 AM, Jonathan Charrier wrote:
> hello everybody,
> i want to extract the name of the rows for the value = "TRUE"
> these names give for the next program a list of file
> i try many functions, and indexation but no solution give to me, i
> transform only the matrix.
> thanks a lot
> Jonathan Charrier
>
> nmodT <- Y.obs1
> Q <- 3
> T <- length(nmodT[,1])*Q
>
> qsd <- colSums(nmodT)
> qsd <- as.matrix(qsd)
>
> aqw<- qsd>T
>
> aqw
>
> [,1]
> 2003-01-01 FALSE
> 2003-01-11 TRUE
...
> 2003-12-21 TRUE
Jonathan,
If you next do row.names(aqw)[aqw[,1]] does that get you
what you want?
Hope this helps,
Stephen
More information about the R-help
mailing list