After files have been scraped to disk they have to processed from cvs files into proper R objects. The first step is to create and inventory and then to create datasets. This function creates datasets. Every csv file has 25 parameters. Creating the entire dataset makes a 350Mb file and takes a long time to process. In the end you have a dataset that conatins all the monthly data from Environment canada.
a sequence of unique station Ids. Ids start at 99111111. They are present as variables in both the file names and the inventories. Ids defaults to NULL. If this is not changed by the caller then all station Ids are used to create the dataset. Alternatively, one can create a subset of all the data by subseting the inventory and working with the Ids from that inventory. For example, one could create datasets for every province or for lat/lon combinations.
This is the filename of the master list of monthly stations. that file is read in get a list of all unique Ids
The directory defaults to EnvCanada where all the csv files are. The csv files all have unique names that are tied to the unique Ids. Given the vector of Ids provided by the caller, and the list of files available, the function then reads in those files to generate a data structure.
The function returns a dataframe of 27 variables, including
Ids, climate data, and the file that was used to create the data.
This data can then be written out by R's write commands. You
can also pass this data through
formatGhcn and create
datasets that can be read by RghcnV3
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.