[R] Query about extracting subset of datafram

From: lalitha viswanath <lalithaviswanath_at_yahoo.com>
Date: Wed 24 Jan 2007 - 20:31:56 GMT

I have a table read from a mysql database which is of the kind

clusterid clockrate

I obtained this table in R as
clockrates_table <-sqlQuery(channel,"select...."); I have a function within which I wish to extract the clusterid for a given cluster.
Although I know that there is just one row per clusterid in the data frame, I am using subset to extract the clockrate.

clockrate = subset(clockrates_table, clusterid==15, select=c(clockrate));

Is there any way of extracting the clockrate without using subset.

In the help section for subset, it mentioned to "see also: [,..."
However I could find no mention for this entry when I searched as "?[", etc.

The R manuals also, despite discussing complex libraries, techniques etc, dont always seem to provide such handy hints/tips and tricks for manipulating data, which is a first stumbling block for newbies like me.
I would greatly appreciate if you could point me to such resources as well, for future reference.


8:00? 8:25? 8:40? Find a flick in no time

R-help@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 and provide commented, minimal, self-contained, reproducible code. Received on Thu Jan 25 16:10:16 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 25 Jan 2007 - 05:30:29 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.