[R] displaying a table in full vs. typing variable name
Liaw, Andy
andy_liaw at merck.com
Thu Jun 10 18:20:03 CEST 2004
Can you show how you know the output has only two columns?
My suspicion is that you are only seeing the `bottom' of the output, as in:
> x <- as.data.frame(matrix(rnorm(45), 5, 9))
> x
V1 V2 V3 V4 V5 V6
V7
1 -1.3241632 -0.9702919 -0.5070715 -0.01663753 -0.4867538 -0.557795429
0.03280373
2 -0.5320836 -0.1909115 -1.7211625 0.96653354 -0.9725586 -0.615651853
-0.94440277
3 1.0103191 -0.2025051 -0.3503634 0.79479308 0.1371226 0.001793848
0.20177179
4 -0.4493096 -0.4028332 0.5452380 -1.10063483 -0.5791613 -0.349573429
-0.15464095
5 1.7484486 0.1401273 1.7100899 0.31960320 1.2972502 -0.039784320
1.24036281
V8 V9
1 -0.7514973 0.07072891
2 -1.0099401 -0.02827683
3 -1.3194879 0.19499958
4 1.7867851 -0.29690245
5 -0.1055813 -0.33510362
Why not use write.table() or even write(), instead of sink()?
Andy
> From: Rishi Ganti
>
> I have a data frame called totaldata that is 10,000 rows by
> about 9 columns. The
> data frame contains many zero entries which are important.
> If I type >totaldata
> it only prints out the first two columns. I expect (and
> want) it to print out all
> 9 columns. (I am actually "sinking" this to a text file, so
> imagine my surprise
> when the text file has only a few columns). I know totaldata
> contains all the data as
> summary(totaldata) lists what I expect (9 variables). Thanks
> for your help.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
More information about the R-help
mailing list