Skip to content

Commit a18ce74

Browse files
Update docs with pkgdev
1 parent efe89ac commit a18ce74

File tree

12 files changed

+16
-12
lines changed

12 files changed

+16
-12
lines changed

R/gisco-cache.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ gisco_set_cache_dir <- function(
131131

132132
giscor_file <- file.path(config_dir, "gisco_cache_dir")
133133

134-
if (!file.exists(giscor_file) || overwrite == TRUE) {
134+
if (!file.exists(giscor_file) || overwrite) {
135135
# Create file if it doesn't exist
136136
writeLines(cache_dir, con = giscor_file)
137137
} else {

R/gisco-get-metadata.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ gisco_get_metadata <- function(
3636
db <- db[db$id_giscor == id, ]
3737
db <- db[db$year == year, ]
3838
db <- db[db$ext == "csv", ]
39-
db <- db[grepl("_AT", db$api_file), ]
39+
db <- db[grepl("_AT", db$api_file, fixed = TRUE), ]
4040

4141
url <- paste0(db$api_entry, "/", db$api_file)
4242
tmp_file <- basename(tempfile(fileext = ".csv"))

R/utils-country.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ convert_country_code <- function(names, out = "eurostat") {
1313
# Vectorize
1414
outnames <- lapply(names, function(x) {
1515
if (
16-
any(grepl("kosovo", tolower(x)), "xk" == tolower(x), "xkx" == tolower(x))
16+
any(
17+
grepl("kosovo", tolower(x), fixed = TRUE),
18+
"xk" == tolower(x),
19+
"xkx" == tolower(x)
20+
)
1721
) {
1822
code <- switch(out,
1923
"eurostat" = "XK",

R/utils-sf.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ read_geo_file_sf <- function(file_local, q = NULL, ...) {
3131

3232
# Read with vszip
3333
file_local <- file.path("/vsizip/", file_local, shp_end)
34-
file_local <- gsub("//", "/", file_local)
34+
file_local <- gsub("//", "/", file_local, fixed = TRUE)
3535
}
3636

3737
if (!is.null(q)) {

R/utils-url.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ download_url <- function(
136136

137137
# Create destfile and clean
138138
file_local <- file.path(cache_dir, name)
139-
file_local <- gsub("//", "/", file_local)
139+
file_local <- gsub("//", "/", file_local, fixed = TRUE)
140140

141141
msg <- paste0("Cache dir is {.path ", cache_dir, "}.")
142142
make_msg("info", verbose, msg)

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@
261261
"applicationCategory": "cartography",
262262
"isPartOf": "http://ropengov.org/",
263263
"keywords": ["ropengov", "r", "spatial", "api-wrapper", "rstats", "r-package", "eurostat", "gisco", "thematic-maps", "eurostat-data", "cran", "ggplot2", "gis", "cran-r"],
264-
"fileSize": "1920.073KB",
264+
"fileSize": "1925.973KB",
265265
"citation": [
266266
{
267267
"@type": "SoftwareSourceCode",
36 Bytes
Loading
144 Bytes
Loading

tests/testthat/test-gisco-id-api.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ test_that("gisco_id_api_lau online", {
133133

134134
expect_s3_class(n, "tbl_df")
135135
expect_true(inherits(n, "sf"))
136-
expect_true(any(grepl("lau", names(n))))
136+
expect_true(any(grepl("lau", names(n), fixed = TRUE)))
137137
# epsg
138138
expect_snapshot(gisco_id_api_lau(epsg = 222, x = 1, y = 1), error = TRUE)
139139

@@ -147,7 +147,7 @@ test_that("gisco_id_api_lau online", {
147147
)
148148
)
149149
expect_s3_class(n, "tbl_df")
150-
expect_true(any(grepl("lau", names(n))))
150+
expect_true(any(grepl("lau", names(n), fixed = TRUE)))
151151
expect_false(inherits(n, "sf"))
152152
})
153153

@@ -194,7 +194,7 @@ test_that("gisco_id_api_river_basin online", {
194194
verbose = TRUE
195195
)
196196
)
197-
expect_true(any(grepl("sizevalue", names(n))))
197+
expect_true(any(grepl("sizevalue", names(n), fixed = TRUE)))
198198

199199
expect_s3_class(n, "tbl_df")
200200

@@ -213,7 +213,7 @@ test_that("gisco_id_api_biogeo_region online", {
213213
verbose = TRUE
214214
)
215215
)
216-
expect_true(any(grepl("biogeo", names(n))))
216+
expect_true(any(grepl("biogeo", names(n), fixed = TRUE)))
217217

218218
expect_s3_class(n, "tbl_df")
219219

@@ -232,7 +232,7 @@ test_that("gisco_id_api_census_grid online", {
232232
verbose = TRUE
233233
)
234234
)
235-
expect_true(any(grepl("grid", names(n))))
235+
expect_true(any(grepl("grid", names(n), fixed = TRUE)))
236236

237237
expect_s3_class(n, "tbl_df")
238238

@@ -247,7 +247,7 @@ test_that("gisco_id_api_census_grid online", {
247247
verbose = FALSE
248248
)
249249
)
250-
expect_true(any(grepl("grid", names(n))))
250+
expect_true(any(grepl("grid", names(n), fixed = TRUE)))
251251

252252
expect_s3_class(n, "tbl_df")
253253

vignettes/africa-1.png

72 Bytes
Loading

0 commit comments

Comments
 (0)