Skip to content

Commit

Permalink
Remove several functions that are also part of HabitusGUI, including …
Browse files Browse the repository at this point in the history
…the loading and updating of the parameters.
  • Loading branch information
vincentvanhees committed Jan 26, 2024
1 parent 384cce1 commit e9cbb73
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 170 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Suggests: testthat, covr, rmarkdown
Depends: stats, utils, R (>= 3.5.0)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
4 changes: 0 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export(build_whenwhatwhere)
export(check_and_clean_palms_data)
export(check_missing_id)
export(hbGIS)
export(load_params)
export(read_config)
export(update_params)
import(dplyr)
import(palmsplusr)
import(sf)
Expand All @@ -31,6 +28,5 @@ importFrom(tidyr,spread)
importFrom(tidyr,unite)
importFrom(utils,head)
importFrom(utils,read.csv)
importFrom(utils,read.table)
importFrom(utils,tail)
importFrom(utils,write.csv)
20 changes: 2 additions & 18 deletions R/hbGIS.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#' @importFrom stats end start formula as.formula
#' @importFrom tidyr pivot_wider
#' @importFrom readr write_csv read_csv
#' @importFrom utils read.csv write.csv
#' @import palmsplusr
#' @import dplyr
#' @importFrom utils head tail
Expand All @@ -39,26 +40,9 @@ hbGIS <- function(gisdir = "",
# Load configuration and define field tables
#===============================================
if (length(configfile) > 0) {
# check for missing parameters, such that hbGIS can fall back on defaults
# here the config_pamsplusr file inside the package is assumed to hold all the defaults.
config_def = system.file("testfiles_hbGIS/config_hbGIS.csv", package = "hbGIS")[1]

params_def = load_params(file = config_def)
params_def$id = rownames(params_def)
params = load_params(file = configfile)
params$id = rownames(params)
missingPar = which(params_def$id %in% params$id == FALSE)
if (length(missingPar) > 0) {
# update the configfile as provide by the user
params = rbind(params, params_def[missingPar,])
params = params[, -which(colnames(params) == "id")]
update_params(new_params = params, file = configfile)
}
rm(params_def)
config <- configfile
} else {
# If no configfile is provided fall back on default
config <- system.file("testfiles_hbGIS/config_hbGIS.csv", package = "hbGIS")[1]
stop("config file not specified")
}
# adding fields
CONF = read.csv(config, sep = ",")
Expand Down
35 changes: 0 additions & 35 deletions R/load_params.R

This file was deleted.

22 changes: 0 additions & 22 deletions R/read_config.R

This file was deleted.

37 changes: 0 additions & 37 deletions R/update_params.R

This file was deleted.

17 changes: 0 additions & 17 deletions man/load_params.Rd

This file was deleted.

17 changes: 0 additions & 17 deletions man/read_config.Rd

This file was deleted.

19 changes: 0 additions & 19 deletions man/update_params.Rd

This file was deleted.

0 comments on commit e9cbb73

Please sign in to comment.