diff --git a/R/load_meta_functions.R b/R/load_meta_functions.R index 7741bf8..879bcdc 100644 --- a/R/load_meta_functions.R +++ b/R/load_meta_functions.R @@ -1,6 +1,7 @@ #' create a JSON File #' #' @param path_data Path to raw file or directory containing raw files. +#' @param silent Error and informational output is hidden if FALSE. #' #' @return JSON object containing the meta data of the raw files. #' @@ -20,7 +21,7 @@ #' } #' @export -generate_json <- function(path_data) +generate_json <- function(path_data, silent = FALSE) { new_file <- tempfile() path_MARMoSET_exe <- system.file( @@ -34,6 +35,7 @@ generate_json <- function(path_data) msg = "path_data is not a file or directory!", severity = "stop", what = "any") + assertive.types::assert_is_a_bool(silent) if(!assertive.reflection::is_windows()) { @@ -41,7 +43,7 @@ generate_json <- function(path_data) } system(command = paste(path_MARMoSET_exe, paste0('"',path_data, '"'), new_file), - intern = T) + show.output.on.console = !silent) json <- jsonlite::fromJSON(new_file) diff --git a/R/sysdata.rda b/R/sysdata.rda new file mode 100644 index 0000000..ba1d347 Binary files /dev/null and b/R/sysdata.rda differ diff --git a/R/term_matching_functions.R b/R/term_matching_functions.R index ac8fa5b..61681f1 100644 --- a/R/term_matching_functions.R +++ b/R/term_matching_functions.R @@ -85,7 +85,7 @@ one_group_match_terms <- function(flat_json, term_matching_table, group_number) } } - meta_data_table %<>% dplyr::mutate(Value = Value %>% stringi::stri_replace_first_fixed('―','-')) + meta_data_table %<>% dplyr::mutate(Value = Value %>% stringi::stri_replace_first_fixed('\U2015','-')) return(meta_data_table) }