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 >> ; >> quit; > > The functional equivalent of is statement in R on a dataframe is: > > TABLE$ones <- 1; > aggregate(TABLE$ones, list(TABLE$a, TABLE$b), sum); > > HTH, > > Jens > > ______________________________________________ > [email protected] 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. > > > =========================================== Dong H. Oh Ph. D Candidate Techno-Economics and Policy Program College of Engineering, Seoul National University, Seoul, 151-050, Republic of Korea E-mail:[EMAIL PROTECTED] Mobile: +82-10-6877-2109 Office : +82-2-880-9142 Fax: +82-2-880-8389 ______________________________________________ [email protected] 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.
