Programmer-friendly names come to rclimateca!

by on February 27, 2017

The most frustrating thing about working with the previous version of the rclimteca package is the column headers given by Environment Canada. In R it is possible to refer to these columns using the backticks or the double bracket, but to save on typing I introduced a predictable column renaming function that removes the hard-to-type and upper-case characters so that column names that were previously something like “Max Temp (°C)” or “Latitude (Decimal Degrees)” become “maxtemp” and “latitude”. The implementation of the testthat package for automated testing highlighted a number of bugs that were discovered and fixed, in addition to integration with the new mudata package (more to come on that in a few weeks!). Give it a shot!

# get nice names for climate data (wide or long)
df <- getClimateData(5585, timeframe="daily", year=2015, nicenames=TRUE)
# get nice names for climate sites
sites <- getClimateSites("gatineau QC", year=2014:2016, nicenames=TRUE)

Leave a Reply

WP Facebook Like Send & Open Graph Meta powered by