I'm creating a function in R. However, I have a large number of function
parameters, and
need to find an efficient solution for running the function with all the
parameters.
So in the following function, I have about 20 parameters that I assign to
the function, with
almost all the values being different. Is there an efficient way to deal
with functions where one has
a lot of parameters?


mynewfunc <- function(campaign, camaignnum, location, locationnum, adgroup,
adgroupnum, keyword, keywordnum,
                             title, titlenu, description, descriptionnum,
url, urlnum, source, sourcenu, bid, budnum,
                             destination, destinationnum){
                                     df =
data.frame(campaign=c(rep(campaign,times=campaignnum)),

 location=c(rep(location,times=locationnum)),
                                     adgroup=c(rep(adgroup,times=adgroup)),

 keyword=c(rep(keyword,times=keywordnum)),
                                     title=c(rep(title1,times=title1num),
rep(title2,times=title2num)),

 description=c(rep(description1,times=descnum1),
rep(description2,times=descnum2)),
                                     url=c(rep(url,urlnum)),
trafficsource=c(rep(source,sourcenum)),
                                     bid=c(rep(bid,bidnum)),
destination=c(rep(destination,destinationnum)))
}



I'm running R 2.13 on Windows 7.

Abraham

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to