[R] how to define a function in R

Nordlund, Dan (DSHS/RDA) NordlDJ at dshs.wa.gov
Wed Jul 7 01:18:45 CEST 2010


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of jd6688
> Sent: Tuesday, July 06, 2010 3:49 PM
> To: r-help at r-project.org
> Subject: [R] how to define a function in R
> 
> 
> 1. how to write a R script?
> 2.How to write a SAS like macro/generic process to process multiple
> files by
> using the same funstion in R?
> 
> Thanks in advance

Don't thank me too soon. :-)  Your question is equivalent to me going to SAS-L and asking someone to teach me SAS macro language.  You need to provide more information about what your task actually is.  Where are these file names that you want to process coming from?  What do you want to do with them?

The basic approach would be to put the file names in a list and then pass the list items one at a time to your function.  But how to do that really depends on what you are trying to do.  You might also read the posting guide listed at the bottom of every posting.

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204




More information about the R-help mailing list