On Sep 2, 2011, at 3:13 PM, Durant, James T. (ATSDR/DTEM/PRMSB) wrote:

Greetings -

I am working on some data that contain chemical names with air concentrations, and I am creating a data frame with date/time and each chemical having its own column. However, these are organic chemicals (e.g. 1-butene, 2,3,4-trimethylbenzene etc). The package I am going to be using the data with is openair, and many of the great functions require you to specify a column name which does not seem to work with improper column names- e.g. smoothTrend(mydata, pollutant="1-Butene" and smoothTrend(mydata, pollutant=mydata[,"1- Butene"])

I was wondering if there was a function to automatically convert these chemical names (with all sorts of numbers and minuses in the beginning) to something openair can handle? Or am I going to be stuck recoding several hundred chemical names in my database?


Try using back-ticks on the invalid names, rather than quotes.

--

David Winsemius, MD
West Hartford, CT

______________________________________________
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