Re: [R] query in R

2006-11-14 Thread Dong H. Oh
sqlQuery() function in RODBC library will be helpful. Sincerely, On Nov 15, 2006, at 1:33 AM, Jens Scheidtmann wrote: > Xiaodong Jin <[EMAIL PROTECTED]> writes: > >> how to realize the following SQL command in R? >> >> select distinct A, B, count(C) >> from TABLE >> group by A, B >> ; >

Re: [R] query in R

2006-11-14 Thread Jens Scheidtmann
Xiaodong Jin <[EMAIL PROTECTED]> writes: > how to realize the following SQL command in R? > > select distinct A, B, count(C) > from TABLE > group by A, B > ; > quit; The functional equivalent of is statement in R on a dataframe is: TABLE$ones <- 1; aggregate(TABLE$ones, list(TABLE$

Re: [R] query in R

2006-11-09 Thread Mark Wardle
Xiaodong Jin wrote: > I just need to query ordinary 3-column excel data e.g. > V1 V2 V3 > I1 C1 1 > I1 C1 1 > ... << DATA snipped >> Hi. It is better to keep discussion on list, rather than emailing individuals. You need to read http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spr

Re: [R] query in R

2006-11-08 Thread Gregor Gorjanc
Jin, Xiaodong Jin yahoo.com> writes: > how to realize the following SQL command in R? > > select distinct A, B, count(C) > from TABLE > group by A, B > ; > quit; > if you want to perform such "query" on a data.frame! then table(table$a, table$b) will produce similar output, but in

Re: [R] query in R

2006-11-08 Thread Mark Wardle
Xiaodong Jin wrote: > how to realize the following SQL command in R? > > select distinct A, B, count(C) > from TABLE > group by A, B > ; > quit; > > Best Regards You don't say which database you are using, but I have found RODBC to be very effective. library("RODBC") Have a l

[R] query in R

2006-11-07 Thread Xiaodong Jin
how to realize the following SQL command in R? select distinct A, B, count(C) from TABLE group by A, B ; quit; Best Regards - Sponsored Link Get a free Motorola Razr! Today Only! Choose Cingular, Sprint, Verizon, Alltel, or T-Mobile.