Sorry for the bad post to start...
I'm trying to do this:
function(pollutant)
##some code here
bad <- is.na(dataset$pollutant)
mean(dataset$pollutant[!bad])
Where
dataset <- read.csv(file, header=TRUE)
The file has multiple pollutants as column names. If I explicitly enter the pollutant name instead of the variable "pollutant" the code works.
For example:
function()
##some code here
bad <- is.na(dataset$CO2)
mean(dataset$CO2[!bad])
What is the correct syntax so I can have a variable pollutant name?