[R] strange data set output

David Winsemius dwinsemius at comcast.net
Sat Jul 3 02:20:50 CEST 2010


The str function would have given you a better one-shot look at  
logit.pred.

-- 
David.


On Jul 2, 2010, at 8:07 PM, Changbin Du wrote:

> Hi, Dear Community,
>
> My data set logit.pred contains 2 columns and 1400 rows.  When I  
> want to use
> the first column, it is very strange. Where the $ come out?  Thanks  
> so much!
>
>> dim(logit.pred)
> [1] 1400    2
>
>> head(logit.pred)
>     tree.pred valid.out
> 754  0.6550606         1
> 1080 0.6353524         1
> 100  0.6371222         1
> 192  0.8145823         1
> 648  0.7155204         1
> 635  0.2012797         1
>
>> logit.pred[1:10,1]
> $`754`
> [1] 0.6550606
>
> $`1080`
> [1] 0.6353524
>
> $`100`
> [1] 0.6371222
>
> $`192`
> [1] 0.8145823
>
> $`648`
> [1] 0.7155204
>
> $`635`
> [1] 0.2012797
>
> $`1810`
> [1] 0.1701353
>
> $`1630`
> [1] 0.8228904
>
> $`238`
> [1] 0.5335658
>
> $`1341`
> [1] 0.7337714
>
>
>
>
> -- 
> Sincerely,
> Changbin
> --
>
> 	[[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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list