Dear R-users, I am looking for a R function that would be the equivalent of the SAS proc freq ( http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#/documentation/cdl/en/procstat/63104/HTML/default/procstat_freq_sect006.htm). The table, ftable, xtabs functions are close but do not quite offer the same capabilities (e.g. they just return counts and no %ages as far as I could tell). I wanted to check with the group if there would already be such a function in base or in a contribution package, before I start coding my own function. Thanks for your feedback. [[alternative HTML version deleted]]
On Jul 25, 2010, at 9:32 AM, S?bastien Bihorel wrote:> Dear R-users, > > I am looking for a R function that would be the equivalent of the > SAS proc > freq ( > http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#/ > documentation/cdl/en/procstat/63104/HTML/default/ > procstat_freq_sect006.htm). > The table, ftable, xtabs functions are close but do not quite offer > the same > capabilities (e.g. they just return counts and no %ages as far as I > could > tell). > I wanted to check with the group if there would already be such a > function > in base or in a contribution package, before I start coding my own > function.There are a couple of efforts to imitate the Proc FREQ output in the archives. If you use one of the several search facilities (e.g. RSeek, the RSiteSearch function or the ??? function in the sos library) you will get links to those: (A test of this theory with RSeek pointed to the CrossTable function in gmodels.) Try also with... ?RsiteSearch RSiteSearch() Or with ... require(sos) ???"proc freq sas" -- David Winsemius, MD West Hartford, CT
you can use prop.tables() on a table() object to get %ages, does this do what you need? ----- Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at' utsa.edu https://rowdyspace.utsa.edu/users/ozd504/www/index.htm -- View this message in context: http://r.789695.n4.nabble.com/R-equivalent-of-SAS-proc-freq-tp2301547p2301607.html Sent from the R help mailing list archive at Nabble.com.