[R] A Few Suggestions to help out newbies

david.whiting@ncl.ac.uk david.whiting at ncl.ac.uk
Tue Apr 2 19:46:00 CEST 2002

On Tue, Apr 02, 2002 at 03:28:13AM -0800, Zed Shaw wrote:


> 2)  A Series of Documents helping people translate from another package
> to R.  For example, "R for SPSS People", "R for SAS People", etc.

The way I started to teach myself how to use and program in R was to
write some functions that either simulated STATA output or at least spat
out a reminder about how to get the output I needed. Here's one example:

stata.encode <- function(){
cat("*** STATA to R ***\nEncode character data as a numbered factor. Take a look at\nas.factor(). Here's a quick example:\n\nx <- as.factor(x)\n\nTo see the codes, use codes(x)\n")

I created a crude library called stata so I could then type:


...which gave me...

*** STATA to R ***
Encode character data as a numbered factor. Take a look at
as.factor(). Here's a quick example:

x <- as.factor(x)

To see the codes, use codes(x)

Not elegant, but this approah helped me. The library is not anywhere
near ready for submitting to CRAN but I agree with the idea behind Zed's
suggestion that people migrating from one system to another think in the
old system to begin with.


Dave Whiting
Dar es Salaam, Tanzania
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list