diff --git a/DESCRIPTION b/DESCRIPTION index f5f8eed..958f607 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: geocompkg Title: Geocomputation with R Metapackage -Version: 2.2.0 +Version: 2.2.1 Authors@R: c(person("Robin", "Lovelace", role = c("aut")), person("Jakub", "Nowosad", email = "nowosad.jakub@gmail.com", role = c("aut", "cre")), @@ -55,7 +55,6 @@ Suggests: lgr, link2GI, lwgeom, - magick, mapdeck, mapsf, mapview, @@ -82,7 +81,6 @@ Suggests: ranger, rcartocolor, readr, - RefManageR, reprex, rgrass, rmapshaper, @@ -96,7 +94,6 @@ Suggests: s2, sfnetworks, smoothr, - sp, stars, stplanr, stringr, @@ -109,12 +106,12 @@ Suggests: tmaptools, tree, vegan, - covr, - metathis + covr Remotes: mlr-org/mlr3extralearners, mlr-org/mlr3proba, - nowosad/spDataLarge + nowosad/spDataLarge, + r-tmap/tmap VignetteBuilder: knitr Encoding: UTF-8 License: CC BY-NC-ND 4.0 diff --git a/NAMESPACE b/NAMESPACE index 7fbe7ec..6ae9268 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,3 +1,2 @@ # Generated by roxygen2: do not edit by hand -export(st_read_sp) diff --git a/R/generate-citations.R b/R/generate-citations.R deleted file mode 100644 index 46fbff9..0000000 --- a/R/generate-citations.R +++ /dev/null @@ -1,53 +0,0 @@ -# Cite R packages -# -# See https://github.com/csgillespie/efficientR/blob/master/appendix.Rmd -generate_citations = function() { - desc = read.dcf("DESCRIPTION") - headings = dimnames(desc)[[2]] - fields = which(headings %in% c("Depends", "Imports", "Suggests")) - pkgs = paste(desc[fields], collapse = ", ") - pkgs = gsub("\n", " ", pkgs) - pkgs = strsplit(pkgs, ",")[[1]] - pkgs = gsub(" ", "", pkgs) - pkgs = gsub("\\(.*)", "", pkgs) # Remove versions from packages - to_install = !pkgs %in% rownames(utils::installed.packages()) - - if(sum(to_install) > 0){ - utils::install.packages(pkgs[to_install]) - } - - i = 1 - pkgs = pkgs[order(pkgs)] - pkgs_df = data.frame(Name = pkgs, Title = NA, cite = NA, version = NA) - for(i in seq_along(pkgs)){ - f = system.file(package = pkgs[i], "DESCRIPTION") - # Title is always on 3rd line - title = readLines(f) - title = title[grep("Title: ", title)] - pkgs_df$Title[i] = gsub("Title: ", "", title) - pkgs_df$cite[i] = paste0("[@R-", pkgs[i], "]") - pkgs_df$version[i] = as.character(utils::packageVersion(pkgs[i])) - } - pkgs_df[,2] = paste(pkgs_df[,2], pkgs_df[,3]) - pkgs_df = pkgs_df[,-3] - utils::write.csv(pkgs_df, "extdata/package_list.csv", row.names = FALSE) - knitr::write_bib(pkgs, file="packages.bib") -} - -# Download citations -# # Dependes on a zotero API key (e.g. stored in Sys.getenv("ZOTERO")): -# # dl_citations(f = "refs.bib", 216746, Sys.getenv("ZOTERO"), collection = "VJS7CTCC") -dl_citations = function(f, user, collection, key = NULL) { - if(is.null(key)) { - req = paste0("https://www.zotero.org/api/groups/", - user, - "/collections/", - collection, - "/items/top?limit=100&format=bibtex&v=1") - bib = httr::GET(req, httr::write_disk(f, overwrite = TRUE)) # old download method - no longer works - } else { - bib = RefManageR::ReadZotero(user = user, .params = list(key = key, collection = collection)) - # Get bibliography (run once from project root) - RefManageR::WriteBib(bib = bib, file = f) - } -} diff --git a/R/save_print_quality.R b/R/save_print_quality.R deleted file mode 100644 index 2cf909e..0000000 --- a/R/save_print_quality.R +++ /dev/null @@ -1,17 +0,0 @@ -# # example for tmap -# library(tmap) -# m = qtm(world) + -# tm_shape(urban_agglomerations) + -# tm_dots(size = "population_millions") + -# tm_facets(by = "year") -# f = "/tmp/urban-animated-print.png" -save_print_quality = function(m = NULL, f, width = 2000, height = 2000) { - if(!is.null(m)) { - if(methods::is(object = m, class2 = "tmap")) { - tmap::tmap_save(tm = m, filename = f, width = width, height = height) - } - } - i = magick::image_read(f) - i_clean = magick::image_trim(i) - magick::image_write(i_clean, f) -} diff --git a/R/st_read_sp.R b/R/st_read_sp.R deleted file mode 100644 index 1e2664d..0000000 --- a/R/st_read_sp.R +++ /dev/null @@ -1,17 +0,0 @@ -#' Fast reading of spatial data into Spatial classes -#' -#' @description -#' Wrapper function to read a file with [sf::st_read()] and the convert the result to a `Spatial` data class -#' -#' @param dsn The path of the data source -#' @param ... Arguments passed to `sf::st_read()` -#' @export -#' @md -#' @examples -#' x = st_read_sp(system.file("shapes/world.gpkg", package = "spData")) -#' class(x) -st_read_sp = function(dsn, ...) { - x = sf::st_read(dsn, ...) - as(object = x, Class = "Spatial") -} - diff --git a/man/st_read_sp.Rd b/man/st_read_sp.Rd deleted file mode 100644 index eec5301..0000000 --- a/man/st_read_sp.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/st_read_sp.R -\name{st_read_sp} -\alias{st_read_sp} -\title{Fast reading of spatial data into Spatial classes} -\usage{ -st_read_sp(dsn, ...) -} -\arguments{ -\item{dsn}{The path of the data source} - -\item{...}{Arguments passed to \code{sf::st_read()}} -} -\description{ -Wrapper function to read a file with \code{\link[sf:st_read]{sf::st_read()}} and the convert the result to a \code{Spatial} data class -} -\examples{ -x = st_read_sp(system.file("shapes/world.gpkg", package = "spData")) -class(x) -}