From b7664f217ceae4b8917f1bd48123978283aecaa8 Mon Sep 17 00:00:00 2001 From: Matthew P Hamilton <30450935+matthewphamilton@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:32:12 +1100 Subject: [PATCH] three more bug fixes --- R/mthd_authorData.R | 7 ++++--- R/mthd_manufacture.R | 2 +- data-raw/mthds/authorData.R | 2 +- data-raw/mthds/manufacture.R | 2 +- data-raw/s4_fns/authorData.R | 3 ++- man/authorData-methods.Rd | 6 +++--- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/R/mthd_authorData.R b/R/mthd_authorData.R index 5691dc8..ce48e18 100644 --- a/R/mthd_authorData.R +++ b/R/mthd_authorData.R @@ -3,7 +3,7 @@ #' @param x An instance of `vicinity_raw`, a ready4 submodule class for tibble object lookup table of metadata about raw (un-processed) spatial data to import. #' @param path_1L_chr Path (a character vector of length one) #' @param data_match_value_xx Data match value (an output object of multiple potential types) -#' @param match_var_nm_1L_chr Match variable name (a character vector of length one), Default: 'name' +#' @param match_var_nm_1L_chr Match variable name (a character vector of length one), Default: 'name_chr' #' @param sub_dirs_chr Sub directories (a character vector), Default: NULL #' @param overwrite_1L_lgl Overwrite (a logical vector of length one), Default: F #' @param what_1L_chr What (a character vector of length one), Default: 'outer' @@ -15,7 +15,7 @@ #' @importFrom dplyr select #' @importFrom ready4use ready4use_dataverses #' @importFrom utils download.file unzip -authorData.vicinity_raw <- function (x, path_1L_chr, data_match_value_xx, match_var_nm_1L_chr = "name", +authorData.vicinity_raw <- function (x, path_1L_chr, data_match_value_xx, match_var_nm_1L_chr = "name_chr", sub_dirs_chr = NULL, overwrite_1L_lgl = F, what_1L_chr = "outer") { if (what_1L_chr == "outer") { @@ -111,7 +111,8 @@ methods::setMethod("authorData", "VicinityLocalRaw", function (x, return_r4_1L_l ready4use::assert_single_row_tb(vicinity_raw_r3) raw_format_sp_dir <- write_raw_format_dir(data_type_chr = vicinity_raw_r3$data_type_chr, raw_fls_dir_1L_chr = x@raw_fls_dir_1L_chr) - imports_chr <- manufacture(x@a_VicinityLookup, type_1L_chr = vicinity_raw_r3$data_type_chr) + imports_chr <- manufacture(x@a_VicinityLookup, type_1L_chr = vicinity_raw_r3$data_type_chr, + what_1L_chr = "imports") write_1L_lgl <- author(x = vicinity_raw_r3, match_vals_xx = imports_chr, path_1L_chr = raw_format_sp_dir, overwrite_1L_lgl = x@overwrite_1L_lgl) if (return_r4_1L_lgl) { diff --git a/R/mthd_manufacture.R b/R/mthd_manufacture.R index b7464fb..4813e2c 100644 --- a/R/mthd_manufacture.R +++ b/R/mthd_manufacture.R @@ -356,7 +356,7 @@ manufacture.vicinity_raw <- function (x, args_ls = NULL, crs_nbr_dbl = NA_real_, collapse = "/")) } if (what_1L_chr == "paths_chr") { - paths_chr <- purrr::map_chr(sub_dirs_chr, ~ready4::get_from_lup_obj(data_lookup_tb = x_vicinity_raw, + paths_chr <- purrr::map_chr(sub_dirs_chr, ~ready4::get_from_lup_obj(data_lookup_tb = x, match_value_xx = match_value_xx, match_var_nm_1L_chr = match_var_nm_1L_chr, target_var_nm_1L_chr = .x, evaluate_1L_lgl = FALSE)) paths_chr <- purrr::accumulate(paths_chr, ~paste0(.x, diff --git a/data-raw/mthds/authorData.R b/data-raw/mthds/authorData.R index f1f0257..ebacc49 100644 --- a/data-raw/mthds/authorData.R +++ b/data-raw/mthds/authorData.R @@ -1,7 +1,7 @@ authorData.vicinity_raw <- function(x, path_1L_chr, data_match_value_xx, - match_var_nm_1L_chr = "name", + match_var_nm_1L_chr = "name_chr", sub_dirs_chr = NULL, overwrite_1L_lgl = F, what_1L_chr = "outer"){ diff --git a/data-raw/mthds/manufacture.R b/data-raw/mthds/manufacture.R index 9a49fcb..9d8e819 100644 --- a/data-raw/mthds/manufacture.R +++ b/data-raw/mthds/manufacture.R @@ -312,7 +312,7 @@ manufacture.vicinity_raw <- function(x, ## write_fls_and_mk_sngl_row_data_lup } if(what_1L_chr == "paths_chr"){ # make_paths_chr paths_chr <- purrr::map_chr(sub_dirs_chr, - ~ ready4::get_from_lup_obj(data_lookup_tb = x_vicinity_raw, + ~ ready4::get_from_lup_obj(data_lookup_tb = x,#x_vicinity_raw match_value_xx = match_value_xx, match_var_nm_1L_chr = match_var_nm_1L_chr, target_var_nm_1L_chr = .x, diff --git a/data-raw/s4_fns/authorData.R b/data-raw/s4_fns/authorData.R index 40f3173..ceecbe3 100644 --- a/data-raw/s4_fns/authorData.R +++ b/data-raw/s4_fns/authorData.R @@ -5,7 +5,8 @@ authorData_VicinityLocalRaw <- function(x, #"author" #write_raw_data_from_sp_loc raw_format_sp_dir <- write_raw_format_dir(data_type_chr = vicinity_raw_r3$data_type_chr, raw_fls_dir_1L_chr = x@raw_fls_dir_1L_chr) imports_chr <- manufacture(x@a_VicinityLookup,#make_imports_chr - type_1L_chr = vicinity_raw_r3$data_type_chr) + type_1L_chr = vicinity_raw_r3$data_type_chr, + what_1L_chr = "imports") write_1L_lgl <- author(x = vicinity_raw_r3, match_vals_xx = imports_chr, path_1L_chr = raw_format_sp_dir,#dir_1L_chr diff --git a/man/authorData-methods.Rd b/man/authorData-methods.Rd index 93a457f..8b141b3 100644 --- a/man/authorData-methods.Rd +++ b/man/authorData-methods.Rd @@ -11,7 +11,7 @@ authorData.vicinity_raw( x, path_1L_chr, data_match_value_xx, - match_var_nm_1L_chr = "name", + match_var_nm_1L_chr = "name_chr", sub_dirs_chr = NULL, overwrite_1L_lgl = F, what_1L_chr = "outer" @@ -21,7 +21,7 @@ authorData.vicinity_raw( x, path_1L_chr, data_match_value_xx, - match_var_nm_1L_chr = "name", + match_var_nm_1L_chr = "name_chr", sub_dirs_chr = NULL, overwrite_1L_lgl = F, what_1L_chr = "outer" @@ -36,7 +36,7 @@ authorData.vicinity_raw( \item{data_match_value_xx}{Data match value (an output object of multiple potential types)} -\item{match_var_nm_1L_chr}{Match variable name (a character vector of length one), Default: 'name'} +\item{match_var_nm_1L_chr}{Match variable name (a character vector of length one), Default: 'name_chr'} \item{sub_dirs_chr}{Sub directories (a character vector), Default: NULL}