davidcarslaw / openair

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

importAURN should allow station name and possibly even local authorities #197

Closed Robinlovelace closed 5 years ago

Robinlovelace commented 5 years ago

Sorry to add to the list, and great package but, as discussed with James Tate, I think it would be very useful for people to be able to enter a local authority name, or at least see a list of stations in the pkg. In fact I'm up for giving this a go: a lookup table is all that's needed. We've built something similar in the stats19 package.

Robinlovelace commented 5 years ago

At the very least the help page should have a link to this: https://uk-air.defra.gov.uk/assets/documents/reports/cat13/1011121246_Site_Classifications_Report_v2.pdf

davidcarslaw commented 5 years ago

Have a look at:

meta <- importMeta(source = "aurn", all = TRUE)

head(meta)
  code               site latitude longitude altitude        site.type                 zone_name zone_id
1   A3 London A3 Roadside 51.37348 -0.291853       32    Urban Traffic Greater London Urban Area     A01
2   A3 London A3 Roadside 51.37348 -0.291853       32    Urban Traffic Greater London Urban Area     A01
3   A3 London A3 Roadside 51.37348 -0.291853       32    Urban Traffic Greater London Urban Area     A01
4   A3 London A3 Roadside 51.37348 -0.291853       32    Urban Traffic Greater London Urban Area     A01
5   A3 London A3 Roadside 51.37348 -0.291853       32    Urban Traffic Greater London Urban Area     A01
6  ABD           Aberdeen 57.15736 -2.094278       20 Urban Background       North East Scotland     Z14
                         la_region la_region_id parameter date_started date_ended ratified_to
1 Kingston upon Thames London Boro          160        CO   20/03/1997 30/09/2007  2007-09-30
2 Kingston upon Thames London Boro          160      PM10   20/03/1997 30/09/2007  2007-09-30
3 Kingston upon Thames London Boro          160        NO   20/03/1997 30/09/2007  2007-09-30
4 Kingston upon Thames London Boro          160       NO2   20/03/1997 30/09/2007  2007-09-30
5 Kingston upon Thames London Boro          160  NOXasNO2   20/03/1997 30/09/2007  2007-09-30
6                    Aberdeen City            1        CO   18/09/1999 30/09/2007  2007-09-30
Robinlovelace commented 5 years ago

Aha, didn't see that function. That solves the problem in terms of code. In terms of documentation, I see it's in there but have tried to make it even clearer where to get metadata for users in #199