Dear all, Is there an R equivalent to SAS's proc format? Best regards J. Lamack _________________________________________________________________ O Windows Live Spaces ? seu espa?o na internet com fotos (500 por m?s), blog e agora com rede social http://spaces.live.com/
lamack lamack wrote:> Dear all, Is there an R equivalent to SAS's proc format? > > Best regards > > J. LamackFortunately not. SAS is one of the few large systems that does not implicitly support value labels and that separates label information from the database [I can't count the number of times someone has sent me a SAS dataset and forgotten to send the PROC FORMAT value labels]. See the factor function for information about how R does this. Frank Harrell -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University
See ?cut for continuous variables, and ?factor, ?levels for the others.> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of lamack lamack > Sent: Tuesday, March 06, 2007 12:49 PM > To: R-help at stat.math.ethz.ch > Subject: [R] R and SAS proc format > > Dear all, Is there an R equivalent to SAS's proc format? > > Best regards > > J. Lamack > > _________________________________________________________________ > O Windows Live Spaces ? seu espa?o na internet com fotos (500 > por m?s), blog > e agora com rede social http://spaces.live.com/ > > ______________________________________________ > R-help at 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. >
The down side to R's factor solution: The numerical values of factors are always 1 to number of levels. Thus, it can be tough and requires great care to work with studies that have both numerical values different from this and value labels. This situation is currently not well-supported by R. Regards, Ulrike P.S.: I fully agree with Frank regarding the annoyance one sometimes encounters with formats in SAS! lamack lamack wrote:> > Dear all, Is there an R equivalent to SAS's proc format? > > Best regards > > J. Lamack > > _________________________________________________________________ > O Windows Live Spaces ? seu espa?o na internet com fotos (500 por m?s), > blog > e agora com rede social http://spaces.live.com/ > > ______________________________________________ > R-help at 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. > >-- View this message in context: http://www.nabble.com/R-and-SAS-proc-format-tf3357624.html#a9340323 Sent from the R help mailing list archive at Nabble.com.