Skip to content

Commit

Permalink
three more bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewphamilton committed Mar 11, 2024
1 parent 79f5078 commit b7664f2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
7 changes: 4 additions & 3 deletions R/mthd_authorData.R
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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") {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/mthd_manufacture.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion data-raw/mthds/authorData.R
Original file line number Diff line number Diff line change
@@ -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"){
Expand Down
2 changes: 1 addition & 1 deletion data-raw/mthds/manufacture.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion data-raw/s4_fns/authorData.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions man/authorData-methods.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b7664f2

Please sign in to comment.