Hello All; I am writing an R program in the form of a function to find out the summary statistics for response variable(s) in a data frame.
I need to accept variable names from the data as arguments and use them inside the function for various tasks. The dataset name is also one of the arguments to the program. The tasks include merging two datasets, transposing a dataset or finding the summary stats of response variable(s) using the input variables as the 'by' variables. The variables specified as argument for the function are taken to be character strings and I have not been able to use these to extract the corresponding variables. As an example, suppose I have an argument 'merge_by' which is used to specify the variables used to merge two datasets. Typically, the input is "an period" (with the double quotes) but could be more or less variables than that. How do I input the user specified variables and use them for tasks like merging, transposing etc.? A similar problem is with specifying the user defined by variables in summaryBy. I have played around with substitute, parse, eval etc. but without success. Any suggestions? Thanks [[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.