[R] Getting only label column of a data frame

From: Gundala Viswanath <gundalav_at_gmail.com>
Date: Mon, 23 Jun 2008 11:16:05 +0900


Hi,

How can I extract the label only from a given data frame.

Fore example from this data frame.

> print(dataf)

          V1 V2 V3 V4 V5 V6 V7 V8 V9

11145    14.3    17.1    31.2    41.7    45.8    49.8    68.6    70.6    72.9
3545     10.2    15.6    20.9    23.2    31.4    31.7    36.2    48.4    51.9
8951     15.2    17.5    20.0    21.4    32.4    49.7    51.3    58.3    58.9
11097    59.5    65.9   117.5   118.0   118.9   122.5   126.3   156.5   157.0

I want to get the label (first) column only:

11145
3545
8951
11097

Is there a quick way to achieve that?
I tried this but fail:

mylable <- dataf[,1]

Please advice.


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. Received on Mon 23 Jun 2008 - 02:19:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 23 Jun 2008 - 02:31:00 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive