Learn R Programming

chcd (version 0.1.1)

build_url: Build a valid URL for downloading a file from CHCD. Follows the format detailed here https://collaboration.cmc.ec.gc.ca/cmc/climate/Get_More_Data_Plus_de_donnees/.

Description

Build a valid URL for downloading a file from CHCD. Follows the format detailed here https://collaboration.cmc.ec.gc.ca/cmc/climate/Get_More_Data_Plus_de_donnees/.

Usage

build_url(station_id, timecode, year, month = NA)

Value

A URL string

Arguments

station_id

The ID of the station to be downloaded

timecode

The numeric timecode to be downloaded

year

The year of data to be loaded

month

The month of the year to download data. Setting to NA gets all months.

Examples

Run this code
build_url(337,3,1980)

# The timecode can also be a string such as "m" or "month"
build_url(337,"m",1990)

# Setting the month is most useful when downloading hourly data
build_url(337,"h",1980,3)

Run the code above in your browser using DataLab