[R-sig-DB] R GUI is puzzling me

Byron Ellis byron@e|||@ @end|ng |rom gm@||@com
Thu Feb 8 07:41:41 CET 2007


date = final[final[i,2],1]

On 2/7/07, d. sarthi maheshwari <samay.sar using gmail.com> wrote:
> Dear Sir/Madam,
>
> I have a data.frame which consist of two columns and several rows. The
> values of 2nd column can be either TRUE or FALSE.
> I want to save all the value of first column in another variable whose
> corresponding row in second column have value TRUE.
>
> Please consider the following example:
>
> #currently i am doing this.
> date <- 0
> j <- 1
> for (i in 1:nrow(final))
> {
>     if(final[i,2] == TRUE)
>     {
>         date[j] <- final[i,1]
>         j <- j+1
>     }
> }
>
> Is there any efficient method (single line code) to do the same?
>
> --
> Thanks & Regards
> Sarthi M.
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-DB mailing list -- R Special Interest Group
> R-sig-DB using stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-db
>


-- 
Byron Ellis (byron.ellis using gmail.com)
"Oook" -- The Librarian




More information about the R-sig-DB mailing list