I would start out by checking out ?switch and getting rid of most of those "if"s .

Next: I apologize for the harshness of this, but your code really does qualify for http://thedailywtf.com . Creating a zillion variables dXY, for example, is really poor programming practice. Create a list or something.



And, this probably should be first: you did not supply an example of what your input "lst" looks like, AND you didn't tell us what your expected result is, nor what the "unexpected result" was. At the risk of speculating wildly, the fact that "lst" is defined inside the function would suggest there's something fundamentally wrong here.


Carl

______________________________________________
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