[R] how do I extract a certain column from a dataframe without headers???

David Winsemius dwinsemius at comcast.net
Fri Jun 3 06:38:33 CEST 2011


On Jun 2, 2011, at 11:21 PM, Soyoung Jang wrote:

>
> The following are the first 6 rows of the data...I named it "file"  
> and I have no idea how I can extract column 15,

But, how did you make it. Is it a data.frame or a matrix?

> because there are no headers in this data.Can you please help me  
> with that?

Perhaps:

named_object[ , 15]

> Thank you!
>
>
> 40 37 1 1 8 8 40 40 1 7 1 0 40  0    41344     7160    49158 21643   
> 3246 1  4 2 25240  1    65809    58387 1135 35 1 1 8 8 39 39 2 6 1  
> 0  0  0    31700     5260    36960 18987  2848 1  3 1 25239  1     
> 64020    58387 1156 53 1 1 8 8 43 39 1 1 4 1 40 32    31025     
> 19025    50050 37699  5654 1  2 0 25237  1    60192    55785 1171 69  
> 1 1 8 8 39 39 5 5 0 0  0  0     7549     7320    14869     0     0  
> 1  2 0 25236  1    54845    54960 1133 40 1 1 8 8 39 42 1 1 1 1 55  
> 46    23992    14052    38044 20559  3083 1  4 2 25212  1   111975    
> 110540 1138 37 1 1 8 8 40 39 1 1 3 1 40 30    23025    13385     
> 36410 19207  2881 1  4 2 25209  1   114615   112468 11 		 	   		
> 	[[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