Skip to content

Commit

Permalink
Update statCanR.Rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
warint authored Nov 20, 2019
1 parent 112d969 commit ac6204e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions vignettes/statCanR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ In details, the sqs_statcan_data() function has 2 arguments:


<<<<<<< HEAD
The tableNumber argument simply referes to the table number of the Statistics Canada data table a user wants to collect, such as '14-10-0287-03' for the labour force variables by province, monthly, seasonally adjusted, as an example.
The tableNumber argument simply refers to the table number of the Statistics Canada data table a user wants to collect, such as '14-10-0287-03' for the labour force variables by province, monthly, seasonally adjusted, as an example.
=======
The 'tableNumber' argument simply referes to the table number of the Statistics Canada data table a user wants to collect, such as '14-10-0287-03' for the labour force variables by province, monthly, seasonally adjusted, as an example.

The 'tableNumber' argument simply refers to the table number of the Statistics Canada data table a user wants to collect, such as '14-10-0287-03' for the labour force variables by province, monthly, seasonally adjusted, as an example.
>>>>>>> 6bd1020c584d751adf2c41ddc8df5697086d0ed0
The second argument, 'lang', refers to the language. As Canada is a bilingual country, Statistics Canada displays all the economic Data in both languages. Therefore, users can choose to collect satistics data tables in French or English by setting the lang argument with c("fra", "eng").
The second argument, 'lang', refers to the language. As Canada is a bilingual country, Statistics Canada displays all the economic data in both languages. Therefore, users can choose to collect satistics data tables in French or English by setting the lang argument with c("fra", "eng").

The code architecture of the sqs_statcan_data() function is the following one:

The first step if to clean the table number in order to align it with the official typology of Statistic Canada's Web Data Service. The second step is to create a temporary folder where all the data wrangling operations are performed. The third step is to check and select the correct language. The fourth step is to define the right URL where the actual data table is stored and then to download the .Zip container. The fifth step is to unzip the previously downloaded .Zip file to extract the data and metadata from the .csv files. The final step is to load the statistics data into a data frame called 'sqs_data' and to add the official table indicator name in the new 'INDICATOR' column.
The first step if to clean the table number in order to align it with the official typology of Statistics Canada's Web Data Service. The second step is to create a temporary folder where all the data wrangling operations are performed. The third step is to check and select the correct language. The fourth step is to define the right URL where the actual data table is stored and then to download the .Zip container. The fifth step is to unzip the previously downloaded .Zip file to extract the data and metadata from the .csv files. The final step is to load the statistics data into a data frame called 'sqs_data' and to add the official table indicator name in the new 'INDICATOR' column.


To be more precise about the sqs_statcan_data() function, here is below a further code description:
Expand Down Expand Up @@ -81,7 +82,7 @@ To be more precise about the sqs_statcan_data() function, here is below a furthe
This section presents an example of how to use the statcanR R package and its function sqs_statcan_data().


The following example is provided to illustrate how to use the function. It consists in collecting some descriptive statistics about the Canadian Labour Force at the federal, provincial and industrial levels, on a monthly basis.
The following example is provided to illustrate how to use the function. It consists in collecting some descriptive statistics about the Canadian labour force at the federal, provincial and industrial levels, on a monthly basis.

With a simple web search 'statistics canada wages by industry metropolitan area monthly', the table number can easily be found on Statisitcs Canada's webpage. Here is below a figure that illustrates this example, such as '14-10-0063-01' for the Employee wages by industry, monthly, unadjusted for seasonality at the ferederal and provincial levels.

Expand Down

0 comments on commit ac6204e

Please sign in to comment.