Skip to content

Commit

Permalink
set up structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisp committed Sep 5, 2017
1 parent 3f69872 commit ec03691
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ vignettes/*.pdf
# Temporary files created by R markdown
*.utf8.md
*.knit.md
.Rproj.user



webrear.zip
data/all-data.csv
Empty file added build.R
Empty file.
57 changes: 57 additions & 0 deletions data/regional-economic-activity-data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Regional Economic Activity Data

This file gives a description of the data displayed on Regional Economic Activity interactive visualisation. The visualisation may be viewed at http://webrear.mbie.govt.nz/.

## indicator
This is a url compatible version of the indicator name as it is used in the Regional Economic Activity Interactive Visualisation. Specifically, entering the url http://webrear.mbie.govt.nz/theme/<<indicator>> where <<indicator>> is replaced by the value in this column, will take you to the correct indicator in the interactive visualisation.

## slice
The `slice` is a label used to distinguish different facets, aggregations and quantities derived from the original datasets. The `slice` label should provide a useful description of the `slice`, however it primarily serves as an identifier.

## dataset
The `dataset` is the name of the original dataset which the indicator values were derived from.

## owner
The `owner` is the organisation that released the original data, and that holds the copyright.

## licence
The `licence` is an abbreviation which describes the licence under which the original data was released. Possible licence abbreviations are listed below:

- **cc-by-4** data are licensed for re-use under a Creative Commons Attribution 4.0 international licence. For more detail see http://creativecommons.org/licenses/by/4.0/

## year
The `year` is the year the `value` refers too. All data have been converted into yearly values regardless of the time period of the original dataset. However values with the same `year` may over different periods (i.e., January to December, or July to June). The `year` refers to the year of the end of the period.

## year_end_month
The `year_end_month` is the month in which the reporting year ends.

## area
The `area` defines the administrative region the value refers too. This can either be a regional council, a territorial authority, a unitary body, or New Zealand itself.

## feature
The `feature` is a dimension label for dataset which have an additional dimension beyond years and areas. For example, the GDP by industry `indicator` includes a set of industry groupings as features.

## feature_group
The `feature_group` is a higher level grouping of the `feature` dimensions. For example, for the tourism spend `indicator` the tourism origin `feature`s are grouped into international and domestic.

## transform
The `transform` defines how the the value has been transformed from the original dataset. For a given `indicator`, the transformations used in the interactive visualisation are available in the download. The possible transforms are described below:

- **original** A value that has not been transformed
- **rate** The annualised rate of change between the current year and the previous year that the data was collected - computed as `100 * (value/prev_value ^ (1/(year - prev_year)) - 1`
- **difference** The difference between the current year and the previous year
- **ratio_vs_NZ** The ratio of the value for the current area to the value for New Zealand as a whole
- **per_capita** The value for the area divided by population and scaled to 10,000 population. Population values are taken from the population estimates indicator. Per capita values are not computed for years or areas where a population estimate is not available.
- **indexed** Indexed values are computed relative to the value for the given area in the first year of the dataset. The index is scaled so that in the first year it has `value` 100. Indexed values are not computed for areas that are missing a value in the first year of the data set
- **regional_fraction** Regional fractions are computed for indicators which have a feature dimension. Regional fractions are the percentage of the regional total of all the features that the current feature represents. For example, in the employment by occupation `indicator` with the managers `feature` selected, the `regional_fraction` is the percentage of total employees in an area who are managers.
- **national_fraction** the national fraction is the percentage of the New Zealand total of a given quantity that is in the current region.

## reference_year
The `reference_year` is included when the `transform` is calculated using two year values. In the case of a rate or difference calculation the `reference_year` is the year of the previous value (which is not always the previous year). For the indexed `transform` the `reference_year` is the first year in the `indicator` dataset.

## value
The `value` is the quantity with the units defined in the `units` column. Rows with a missing value have been dropped.

## units
The `units` of the `value`.

4 changes: 4 additions & 0 deletions prep/download-rear.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

url <- "http://www.mbie.govt.nz/info-services/business/business-growth-agenda/regions/documents-image-library/REAR-Webtool-20160610.zip"
download.file(url, destfile = "webrear.zip", mode = "wb")
unzip("webrear.zip", exdir = "data")
13 changes: 13 additions & 0 deletions rmarkdown-corporate-eg.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: knitr
LaTeX: pdfLaTeX

0 comments on commit ec03691

Please sign in to comment.