Skip to content

Commit d2c0490

Browse files
authored
Merge pull request #88 from mountainMath/v0.3.6
V0.3.6
2 parents e4fff40 + 7ff77e4 commit d2c0490

124 files changed

Lines changed: 6016 additions & 1260 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
^\.Rproj\.user$
77
^docs
88
^pkgdown
9-
.travis.yml
9+
^\.travis.yml
10+
^\.travis_disabled.yml
1011
cran-comments.md
1112
vignettes/listing_cansim_tables.Rmd
1213
vignettes/working_with_hierarchies.Rmd
@@ -15,3 +16,5 @@ R/hex_sticker.R
1516
images
1617
images/*
1718
fix_meta.sh
19+
^\.github
20+
^\.github/*

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# NOTE: This workflow is overkill for most R packages
2+
# check-standard.yaml is likely a better choice
3+
# usethis::use_github_action("check-standard") will install it.
4+
#
5+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
6+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
7+
on:
8+
push:
9+
branches:
10+
- main
11+
- master
12+
pull_request:
13+
branches:
14+
- main
15+
- master
16+
17+
name: R-CMD-check
18+
19+
jobs:
20+
R-CMD-check:
21+
runs-on: ${{ matrix.config.os }}
22+
23+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
config:
29+
- {os: macOS-latest, r: 'release'}
30+
# - {os: windows-latest, r: 'release'}
31+
- {os: windows-latest, r: '3.6'}
32+
- {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
33+
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
34+
- {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
35+
- {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
36+
- {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
37+
# - {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
38+
39+
env:
40+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
41+
RSPM: ${{ matrix.config.rspm }}
42+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
43+
CM_API_KEY: ${{ secrets.CM_API_KEY }}
44+
COMPILE_VIG: ${{ secrets.COMPILE_VIG }}
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
49+
- uses: r-lib/actions/setup-r@v1
50+
with:
51+
r-version: ${{ matrix.config.r }}
52+
http-user-agent: ${{ matrix.config.http-user-agent }}
53+
54+
- uses: r-lib/actions/setup-pandoc@v1
55+
56+
- name: Query dependencies
57+
run: |
58+
install.packages('remotes')
59+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
60+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
61+
shell: Rscript {0}
62+
63+
- name: Cache R packages
64+
if: runner.os != 'Windows'
65+
uses: actions/cache@v2
66+
with:
67+
path: ${{ env.R_LIBS_USER }}
68+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
69+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
70+
71+
- name: Install system dependencies
72+
if: runner.os == 'Linux'
73+
run: |
74+
while read -r cmd
75+
do
76+
eval sudo $cmd
77+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "16.04"))')
78+
79+
- name: Install dependencies
80+
run: |
81+
remotes::install_deps(dependencies = TRUE)
82+
remotes::install_cran("rcmdcheck")
83+
shell: Rscript {0}
84+
85+
- name: Session info
86+
run: |
87+
options(width = 100)
88+
pkgs <- installed.packages()[, "Package"]
89+
sessioninfo::session_info(pkgs, include_base = TRUE)
90+
shell: Rscript {0}
91+
92+
- name: Check
93+
env:
94+
_R_CHECK_CRAN_INCOMING_: false
95+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
96+
shell: Rscript {0}
97+
98+
- name: Show testthat output
99+
if: always()
100+
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
101+
shell: bash
102+
103+
- name: Upload check results
104+
if: failure()
105+
uses: actions/upload-artifact@main
106+
with:
107+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
108+
path: check

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ doc
77
R/.Rapp.history
88
.Ruserdata
99
inst/doc
10+
/doc/
11+
/Meta/

.travis.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.travis_disabled.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: R
2+
cache:
3+
- packages
4+
- ccache
5+
sudo: false
6+
latex: false
7+
pandoc: false
8+
os: linux
9+
dist: bionic
10+
11+
r:
12+
- release

CRAN-RELEASE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
This package was submitted to CRAN on 2020-03-04.
2-
Once it is accepted, delete this file and tag the release (commit a832cfd467).
1+
This package was submitted to CRAN on 2021-05-07.
2+
Once it is accepted, delete this file and tag the release (commit fa498df).

DESCRIPTION

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: cansim
22
Type: Package
33
Title: Accessing Statistics Canada Data Table and Vectors
4-
Version: 0.3.5
4+
Version: 0.3.6
55
Authors@R: c(
66
person("Jens", "von Bergmann", email = "jens@mountainmath.ca", role = c("cre")),
77
person("Dmitry", "Shkolnik", email = "shkolnikd@gmail.com", role = c("aut")))
@@ -12,10 +12,14 @@ Description: Searches for, accesses, and retrieves new-format and old-format Sta
1212
to make it easier to work with retrieved table data. Optional caching features are provided.
1313
License: MIT + file LICENSE
1414
Encoding: UTF-8
15+
ByteCompile: yes
16+
NeedsCompilation: no
1517
LazyData: true
1618
Depends: R (>= 2.10)
17-
Imports: dplyr (>= 0.7),
19+
Imports: digest (>= 0.1),
20+
dplyr (>= 0.7),
1821
httr (>= 1.0.0),
22+
jsonlite (>= 1.0),
1923
readr,
2024
rlang,
2125
xml2,
@@ -24,14 +28,16 @@ Imports: dplyr (>= 0.7),
2428
purrr,
2529
tibble,
2630
utils,
27-
jsonlite
28-
RoxygenNote: 7.1.0
31+
DBI,
32+
RSQLite,
33+
dbplyr
34+
RoxygenNote: 7.1.1
2935
Suggests: knitr,
3036
rmarkdown,
3137
scales,
3238
tidyr,
3339
ggplot2
34-
URL: https://github.com/mountainMath/cansim, https://mountainmath.github.io/cansim/
40+
URL: https://github.com/mountainMath/cansim, https://mountainmath.github.io/cansim/, https://www.statcan.gc.ca/
3541
BugReports: https://github.com/mountainMath/cansim/issues
3642
VignetteBuilder: knitr
3743
Language: en-CA

NAMESPACE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export(add_provincial_abbreviations)
44
export(adjust_cansim_values_by_variable)
55
export(cansim_old_to_new)
66
export(categories_for_level)
7+
export(collect_and_normalize)
8+
export(disconnect_cansim_sqlite)
79
export(get_cansim)
810
export(get_cansim_changed_tables)
911
export(get_cansim_code_set)
@@ -12,6 +14,7 @@ export(get_cansim_column_list)
1214
export(get_cansim_cube_metadata)
1315
export(get_cansim_data_for_table_coord_periods)
1416
export(get_cansim_ndm)
17+
export(get_cansim_sqlite)
1518
export(get_cansim_table_info)
1619
export(get_cansim_table_notes)
1720
export(get_cansim_table_overview)
@@ -23,8 +26,10 @@ export(get_cansim_vector)
2326
export(get_cansim_vector_for_latest_periods)
2427
export(get_cansim_vector_info)
2528
export(list_cansim_cubes)
29+
export(list_cansim_sqlite_cached_tables)
2630
export(list_cansim_tables)
2731
export(normalize_cansim_values)
32+
export(remove_cansim_sqlite_cached_table)
2833
export(search_cansim_cubes)
2934
export(search_cansim_tables)
3035
export(view_cansim_webpage)
@@ -37,4 +42,6 @@ importFrom(rvest,html_node)
3742
importFrom(rvest,html_nodes)
3843
importFrom(rvest,html_text)
3944
importFrom(stats,na.omit)
45+
importFrom(stats,setNames)
4046
importFrom(tibble,as.tibble)
47+
importFrom(utils,head)

NEWS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# cansim 0.3.6
2+
## Major changes
3+
* Fold part of `normalize_cansim_values` into the default table and vector output, in particular always add a scaled variable column called `val_norm` and an imputed `Date` column and covert categories to factors by default.
4+
* New `get_cansim_sqlite` function that stores tables in an SQLite database and facilitates access and managemet of data.
5+
6+
## Minor changes
7+
* Adapt to changes in dplyr, tidyr, and tibble
8+
* fix a bug that would not properly add hierarchies when category names are repeated
9+
* Use system unzip if `getOption("unzip")` is set to enable unzip for files larger than 4GB on unix-like systems
10+
111
# cansim 0.3.5
212

313
## Minor changes

0 commit comments

Comments
 (0)