davidcarslaw / openair

Tools for air quality data analysis
https://davidcarslaw.github.io/openair/
GNU General Public License v2.0
304 stars 113 forks source link

timePlot does not work with tbl_df #39

Closed maelle closed 8 years ago

maelle commented 8 years ago

timePlot does not seem to work with objects of the class tbl_df from the useful dplyr package.

library("openair")
library("dplyr")
timePlot(mydata, pollutant="so2")
mydata2 <- dplyr::tbl_df(mydata)
class(mydata2)
timePlot(mydata2, pollutant="so2")

The second timePlot call outputs "unknown name".

Why is it so?

Thanks a lot in advance!

maelle commented 8 years ago

(for now I deal with the issue by transforming my tbl_df tables using as.data.frame)

Example here https://github.com/masalmon/Ropenaq/blob/master/develop/using_openair.R

I also need to write this somewhere: your package is really cool! it's such a pleasure to play with the plotting functions!

davidcarslaw commented 8 years ago

strange - there should not be any problem with this as tbls from dplyr are fully compatible with data frames. All your code works fine for me. Is it worth checking you have up to date R + packages? Could you try your code in a clean R session also?

maelle commented 8 years ago

Oh thanks, I seem to not to have up-to-date R and I have no admin rights... Well I'll keep converting for a while but write in my code that it's only a problem on my PC, thanks!