An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060203/f917c851/attachment.pl
How to get all the data in a specific column from a dataframe?
3 messages · Vincent Deng, Chuck Cleland, Peter Dalgaard
test_frame[,"col3"] or subset(test_frame, select = col3)
Vincent Deng wrote:
Dear R-helpers:
Suppose I have a datafram called "test_frame" like this
col1 col2 col3 col4
r1 x x x x
r2 x x x x
r3 x x x x
.. x x x x
rn x x x x
I know I can get data of col3 by using test_frame[,3].
My question is, if I want to do this by specifying "col3" rather than 3,
what should I do?
Many thanks....
[[alternative HTML version deleted]]
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894
Chuck Cleland <ccleland at optonline.net> writes:
test_frame[,"col3"] or subset(test_frame, select = col3)
or test_frame$col3
O__ ---- Peter Dalgaard ??ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907