You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' @description bind_tables_from_loc_files() is a Bind function that binds two objects together to create a composite object. Specifically, this function implements an algorithm to bind tables from local files. The function returns Table (an output object of multiple potential types).
3
+
#' @param paths_chr Paths (a character vector)
4
+
#' @param force_numeric_1L_lgl Force numeric (a logical vector of length one), Default: F
5
+
#' @param force_tb_1L_lgl Force tibble (a logical vector of length one), Default: F
#' @description get_digits_from_text() is a Get function that retrieves a pre-existing data object from memory, local file system or online repository. Specifically, this function implements an algorithm to get digits from text. Function argument text_1L_chr specifies the where to look for the required object. The function returns Digits (a character vector).
99
+
#' @param text_1L_chr Text (a character vector of length one)
100
+
#' @return Digits (a character vector)
101
+
#' @rdname get_digits_from_text
102
+
#' @export
103
+
#' @keywords internal
104
+
get_digits_from_text<-function (text_1L_chr)
105
+
{
106
+
fn_attribution_1L_chr<-"This function is based on: http://stla.github.io/stlapblog/posts/Numextract.html"
#' @description get_dv_fls_urls() is a Get function that retrieves a pre-existing data object from memory, local file system or online repository. Specifically, this function implements an algorithm to get dataverse files urls. Function argument file_nms_chr specifies the where to look for the required object. The function returns Urls (a character vector).
99
113
#' @param file_nms_chr File names (a character vector)
#' @description get_table_from_loc_file() is a Get function that retrieves a pre-existing data object from memory, local file system or online repository. Specifically, this function implements an algorithm to get table from local file. Function argument path_1L_chr specifies the where to look for the required object. The function returns Table (an output object of multiple potential types).
516
+
#' @param path_1L_chr Path (a character vector of length one)
517
+
#' @param force_numeric_1L_lgl Force numeric (a logical vector of length one), Default: F
518
+
#' @param force_tb_1L_lgl Force tibble (a logical vector of length one), Default: F
Copy file name to clipboardExpand all lines: R/fn_transform.R
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,22 @@
1
+
#' Transform character vector to numeric
2
+
#' @description transform_chr_to_num() is a Transform function that edits an object in such a way that core object attributes - e.g. shape, dimensions, elements, type - are altered. Specifically, this function implements an algorithm to transform character vector to numeric. Function argument digits_chr specifies the object to be updated. The function returns Digits (an output object of multiple potential types).
3
+
#' @param digits_chr Digits (a character vector)
4
+
#' @return Digits (an output object of multiple potential types)
5
+
#' @rdname transform_chr_to_num
6
+
#' @export
7
+
#' @keywords internal
8
+
transform_chr_to_num<-function (digits_chr)
9
+
{
10
+
fn_attribution_1L_chr<-"This function is based on: https://stackoverflow.com/questions/24129124/how-to-determine-if-a-character-vector-is-a-valid-numeric-or-integer-vector"
if (!identical(tfd_digits_chr, character(0)) & suppressWarnings(all(!is.na(as.numeric(tfd_digits_chr))))) {
13
+
digits_xx<- as.numeric(as.character(digits_chr))
14
+
}
15
+
else {
16
+
digits_xx<-digits_chr
17
+
}
18
+
return(digits_xx)
19
+
}
1
20
#' Transform class type list
2
21
#' @description transform_cls_type_ls() is a Transform function that edits an object in such a way that core object attributes - e.g. shape, dimensions, elements, type - are altered. Specifically, this function implements an algorithm to transform class type list. Function argument cls_type_ls specifies the object to be updated. The function returns Tfmd class type (a list).
#' @description write_fls_to_repo() is a Write function that writes a file to a specified local directory. Specifically, this function implements an algorithm to write files to repository. The function returns Identities (an integer vector).
264
264
#' @param paths_chr Paths (a character vector)
265
265
#' @param descriptions_chr Descriptions (a character vector)
266
+
#' @param consent_1L_chr Consent (a character vector of length one), Default: ''
266
267
#' @param ds_url_1L_chr Dataset url (a character vector of length one), Default: character(0)
267
268
#' @param ds_ls Dataset (a list), Default: NULL
268
269
#' @param key_1L_chr Key (a character vector of length one), Default: Sys.getenv("DATAVERSE_KEY")
@@ -449,6 +459,67 @@ write_new_files <- function (paths_chr, custom_write_ls = NULL, fl_nm_1L_chr = N
449
459
}
450
460
}
451
461
}
462
+
#' Write object with prompt
463
+
#' @description write_obj_with_prompt() is a Write function that writes a file to a specified local directory. Specifically, this function implements an algorithm to write object with prompt. The function is called for its side effects and does not return a value. WARNING: This function writes R scripts to your local environment. Make sure to only use if you want this behaviour
#' @description write_prj_outp_dirs() is a Write function that writes a file to a specified local directory. Specifically, this function implements an algorithm to write project output directories. The function returns New paths (a list).
489
+
#' @param prj_dirs_chr Project directories (a character vector)
490
+
#' @param output_data_dir_1L_chr Output data directory (a character vector of length one)
491
+
#' @param consent_1L_chr Consent (a character vector of length one), Default: ''
#' @description write_tb_to_csv() is a Write function that writes a file to a specified local directory. Specifically, this function implements an algorithm to write tibble to comma separated variables file. The function is called for its side effects and does not return a value. WARNING: This function writes R scripts to your local environment. Make sure to only use if you want this behaviour
0 commit comments