Skip to content

Commit ef650d9

Browse files
committed
replace dontrun with donttest for examples that hit the statcan web server and drop dontrun from the two examples that don't make any web request.
1 parent 5c03f8b commit ef650d9

60 files changed

Lines changed: 484 additions & 148 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.

R/cansim.R

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' @return tibble format data table output
1313
#'
1414
#' @examples
15-
#' \dontrun{
15+
#' \donttest{
1616
#' # Retrieve a table with an NDM code
1717
#' get_cansim("34-10-0013")
1818
#' # Retrieve a table with an old-style CANSIM code
@@ -51,7 +51,7 @@ adjust_cansim_values_by_variable <-function(data, var){
5151
#' @return Returns the input tibble with with adjusted values
5252
#'
5353
#' @examples
54-
#' \dontrun{
54+
#' \donttest{
5555
#' cansim_table <- get_cansim("34-10-0013")
5656
#' normalize_cansim_values(cansim_table)
5757
#' }
@@ -138,7 +138,7 @@ normalize_cansim_values <- function(data, replacement_value=NA, normalize_percen
138138
#' @return new-format NDM table number
139139
#'
140140
#' @examples
141-
#' \dontrun{
141+
#' \donttest{
142142
#' cansim_old_to_new("026-0018")
143143
#' }
144144
#' @export
@@ -307,7 +307,7 @@ parse_and_fold_in_metadata <- function(data,meta,data_path){
307307
#' @return tibble format data table output
308308
#'
309309
#' @examples
310-
#' \dontrun{
310+
#' \donttest{
311311
#' get_cansim("34-10-0013")
312312
#' }
313313
#' @export
@@ -379,7 +379,7 @@ get_cansim_ndm <- function(cansimTableNumber, language="english", refresh=FALSE,
379379
# Set to higher values for large tables and slow network connection. (Default is \code{200}).
380380
#'
381381
#' @examples
382-
#' \dontrun{
382+
#' \donttest{
383383
#' get_cansim_table_info("34-10-0013")
384384
#' }
385385
#' @export
@@ -403,7 +403,7 @@ get_cansim_table_info <- function(cansimTableNumber, language="english", refresh
403403
# Set to higher values for large tables and slow network connection. (Default is \code{200}).
404404
#'
405405
#' @examples
406-
#' \dontrun{
406+
#' \donttest{
407407
#' get_cansim_table_survey("34-10-0013")
408408
#' }
409409
#' @export
@@ -426,7 +426,7 @@ get_cansim_table_survey <- function(cansimTableNumber, language="english", refre
426426
# Set to higher values for large tables and slow network connection. (Default is \code{200}).
427427
#'
428428
#' @examples
429-
#' \dontrun{
429+
#' \donttest{
430430
#' get_cansim_table_subject("34-10-0013")
431431
#' }
432432
#' @export
@@ -449,7 +449,7 @@ get_cansim_table_subject <- function(cansimTableNumber, language="english", refr
449449
# Set to higher values for large tables and slow network connection. (Default is \code{200}).
450450
#'
451451
#' @examples
452-
#' \dontrun{
452+
#' \donttest{
453453
#' get_cansim_table_short_notes("34-10-0013")
454454
#' }
455455
#' @export
@@ -472,7 +472,7 @@ get_cansim_table_short_notes <- function(cansimTableNumber, language="english",
472472
# Set to higher values for large tables and slow network connection. (Default is \code{200}).
473473
#'
474474
#' @examples
475-
#' \dontrun{
475+
#' \donttest{
476476
#' get_cansim_column_list("34-10-0013")
477477
#' }
478478
#' @export
@@ -496,7 +496,7 @@ get_cansim_column_list <- function(cansimTableNumber, language="english", refres
496496
# Set to higher values for large tables and slow network connection. (Default is \code{200}).
497497
#'
498498
#' @examples
499-
#' \dontrun{
499+
#' \donttest{
500500
#' get_cansim_column_categories("34-10-0013", "Geography")
501501
#' }
502502
#' @export
@@ -523,7 +523,7 @@ get_cansim_column_categories <- function(cansimTableNumber, column, language="en
523523
#' @return none
524524
#'
525525
#' @examples
526-
#' \dontrun{
526+
#' \donttest{
527527
#' get_cansim_table_overview("34-10-0013")
528528
#' }
529529
#' @export
@@ -568,7 +568,7 @@ get_cansim_table_overview <- function(cansimTableNumber, language="english", ref
568568
#' @return A vector of categories
569569
#'
570570
#' @examples
571-
#' \dontrun{
571+
#' \donttest{
572572
#' data <- get_cansim("16-10-0117")
573573
#' categories_for_level(data,"North American Industry Classification System (NAICS)",level=2)
574574
#' }
@@ -662,7 +662,7 @@ generate_table_metadata <- function(){
662662
#' @return none
663663
#'
664664
#' @examples
665-
#' \dontrun{
665+
#' \donttest{
666666
#' view_cansim_webpage("34-10-0013")
667667
#' }
668668
#' @export
@@ -682,7 +682,7 @@ view_cansim_webpage <- function(cansimTableNumber){
682682
#' @return a tibble containing the table metadata
683683
#'
684684
#' @examples
685-
#' \dontrun{
685+
#' \donttest{
686686
#' get_cansim_cube_metadata("34-10-0013")
687687
#' }
688688
#' @export
@@ -733,7 +733,7 @@ get_cansim_cube_metadata <- function(cansimTableNumber){
733733
#' @return String object containing URL for specified table number
734734
#'
735735
#' @examples
736-
#' \dontrun{
736+
#' \donttest{
737737
#' get_cansim_table_url("34-10-0013")
738738
#' get_cansim_table_url("34-10-0013", language = "fr")
739739
#' }
@@ -757,7 +757,7 @@ get_cansim_table_url <- function(cansimTableNumber, language = "en"){
757757
#' @return A tibble with Statistics Canada data table product ids and their release times
758758
#'
759759
#' @examples
760-
#' \dontrun{
760+
#' \donttest{
761761
#' get_cansim_changed_tables("2018-08-01")
762762
#' }
763763
#' @export
@@ -786,7 +786,7 @@ get_cansim_changed_tables <- function(start_date){
786786
# Set to higher values for large tables and slow network connection. (Default is \code{200}).
787787
#'
788788
#' @examples
789-
#' \dontrun{
789+
#' \donttest{
790790
#' get_cansim_table_notes("34-10-0013")
791791
#' }
792792
#' @export

R/cansim_helpers.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ short_prov.fr <- purrr::set_names(c(
177177
#' @return a code{cansim} package data frame with additional factor GEO.abb that contains language-specific provincial abbreviations
178178
#'
179179
#' @examples
180-
#' \dontrun{
180+
#' \donttest{
181181
#' df <- get_cansim("17-10-0005")
182182
#' df <- add_provincial_abbreviations(df)
183183
#' }
@@ -206,7 +206,7 @@ add_provincial_abbreviations <- function(data){
206206
#' @return a tibble with english and french labels for the given code set
207207
#'
208208
#' @examples
209-
#' \dontrun{
209+
#' \donttest{
210210
#' get_cansim_code_set("survey")
211211
#' }
212212
get_cansim_code_set <- function(code_set=c("scalar", "frequency", "symbol", "status", "uom", "survey", "subject", "wdsResponseStatus"),

R/cansim_tables_list.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ get_cansim_table_list_page <- function(start_offset=0,max_rows=1000){
102102
#' @return A tibble with available Statistics Canada data tables, listing title, Statistics Canada data table catalogue number, deprecated CANSIM table number, description, and geography
103103
#'
104104
#' @examples
105-
#' \dontrun{
105+
#'
106106
#' list_cansim_tables()
107-
#' }
107+
#'
108108
#' @export
109109
list_cansim_tables <- function(refresh=FALSE){
110110
# flow: if cansim.cache_path version exists, use that, otherwise fall back on package version
@@ -152,9 +152,9 @@ list_cansim_tables <- function(refresh=FALSE){
152152
#' @return A tibble with available Statistics Canada data tables, listing title, Statistics Canada data table catalogue number, deprecated CANSIM table number, description and geography that match the search term.
153153
#'
154154
#' @examples
155-
#' \dontrun{
155+
#'
156156
#' search_cansim_tables("Labour force")
157-
#' }
157+
#'
158158
#' @export
159159
search_cansim_tables <- function(search_term, search_fields = "both", refresh=FALSE){
160160
tables <- list_cansim_tables(refresh = refresh)
@@ -183,7 +183,7 @@ search_cansim_tables <- function(search_term, search_fields = "both", refresh=FA
183183
#' start and end dates, achieve status, subject and survey codes, frequency codes and a list of cube dimensions.
184184
#'
185185
#' @examples
186-
#' \dontrun{
186+
#' \donttest{
187187
#' list_cansim_cubes()
188188
#' }
189189
#'
@@ -262,7 +262,7 @@ list_cansim_cubes <- function(lite=FALSE,refresh=FALSE){
262262
#' @return A tibble with available Statistics Canada data cubes, listing title, Statistics Canada data cube catalogue number, deprecated CANSIM table number, survey and subject.
263263
#'
264264
#' @examples
265-
#' \dontrun{
265+
#' \donttest{
266266
#' search_cansim_cubes("Labour force")
267267
#' }
268268
#'

R/cansim_vectors.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ rename_vectors <- function(data,vectors){
7777
#' @return A tibble with data for vectors released between start and end time
7878
#'
7979
#' @examples
80-
#' \dontrun{
80+
#' \donttest{
8181
#' get_cansim_vector("v41690973","2015-01-01")
8282
#' }
8383
#' @export
@@ -126,7 +126,7 @@ get_cansim_vector<-function(vectors, start_time, end_time=Sys.time(), use_ref_da
126126
#' @return A tibble with data for specified vector(s) for the last N periods
127127
#'
128128
#' @examples
129-
#' \dontrun{
129+
#' \donttest{
130130
#' get_cansim_vector_for_latest_periods("v41690973",10)
131131
#' }
132132
#' @export
@@ -172,7 +172,7 @@ get_cansim_vector_for_latest_periods<-function(vectors, periods=1){
172172
#' @return A tibble with data matching specified coordinate and period input arguments
173173
#'
174174
#' @examples
175-
#' \dontrun{
175+
#' \donttest{
176176
#' get_cansim_data_for_table_coord_periods("35-10-0003",coordinate="1.12.0.0.0.0.0.0.0.0",periods=3)
177177
#' }
178178
#' @export
@@ -207,7 +207,7 @@ get_cansim_data_for_table_coord_periods<-function(cansimTableNumber, coordinate,
207207
#' @return A tibble with metadata for selected vectors
208208
#'
209209
#' @examples
210-
#' \dontrun{
210+
#' \donttest{
211211
#' get_cansim_vector_info("v41690973")
212212
#' }
213213
#' @export

docs/articles/index.html

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/add_provincial_abbreviations.html

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/cansim_old_to_new.html

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)