Skip to content

Commit 334ba47

Browse files
addressed naming convention fails
1 parent 65969f8 commit 334ba47

42 files changed

Lines changed: 92 additions & 84 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

R/fn_add.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ add_indefartls_to_phrases <- function (abbreviated_phrase_1L_chr, abbreviations_
8585
#' @param template_lup Template (a lookup table)
8686
#' @param new_lup New (a lookup table)
8787
#' @param key_var_nm_1L_chr Key var name (a character vector of length one)
88-
#' @param priority_lup_for_dupls PARAM_DESCRIPTION, Default: 'template'
88+
#' @param priority_lup_for_dupls_1L_chr Priority lookup table for dupls (a character vector of length one), Default: 'template'
8989
#' @return NA ()
9090
#' @rdname add_lups
9191
#' @export
@@ -95,11 +95,11 @@ add_indefartls_to_phrases <- function (abbreviated_phrase_1L_chr, abbreviations_
9595
#' @importFrom Hmisc label
9696
#' @importFrom sjlabelled unlabel
9797
#' @keywords internal
98-
add_lups <- function (template_lup, new_lup, key_var_nm_1L_chr, priority_lup_for_dupls = "template")
98+
add_lups <- function (template_lup, new_lup, key_var_nm_1L_chr, priority_lup_for_dupls_1L_chr = "template")
9999
{
100100
testit::assert("Look up tables must have same column names",
101101
names(template_lup) == names(new_lup))
102-
if (priority_lup_for_dupls == "template") {
102+
if (priority_lup_for_dupls_1L_chr == "template") {
103103
new_lup <- new_lup %>% dplyr::filter(!(!!rlang::sym(key_var_nm_1L_chr) %in%
104104
(template_lup %>% dplyr::pull(!!rlang::sym(key_var_nm_1L_chr)))))
105105
labels_chr <- Hmisc::label(template_lup) %>% unname()

R/fn_import.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#' @importFrom purrr map
1010
#' @importFrom readxl read_excel
1111
#' @importFrom stats setNames
12+
#' @keywords internal
1213
import_xls_sheets <- function (range_1L_chr, sheet_names_chr, path_1L_chr)
1314
{
1415
tb_ls <- purrr::map(sheet_names_chr, ~readxl::read_excel(path = path_1L_chr,

R/fn_make.R

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ make_arg_type_lup_ls <- function (object_type_lup = NULL)
211211
purrr::map(~dplyr::filter(new_lup, nchar_int == .x))
212212
return(lup_ls)
213213
}
214-
#' Make depnt functions
215-
#' @description make_depnt_fns_ls() is a Make function that creates a new R object. Specifically, this function implements an algorithm to make depnt functions list. The function returns Argument (a list).
214+
#' Make dependent functions
215+
#' @description make_depnt_fns_ls() is a Make function that creates a new R object. Specifically, this function implements an algorithm to make dependent functions list. The function returns Argument (a list).
216216
#' @param arg_ls Argument (a list)
217217
#' @param pkg_depcy_ls Package dependency (a list)
218218
#' @return Argument (a list)
@@ -430,6 +430,7 @@ make_fn_dmt_spine <- function (fn_name_1L_chr, fn_type_1L_chr, fn_title_1L_chr =
430430
#' @importFrom utils data
431431
#' @importFrom purrr map_lgl discard
432432
#' @importFrom rlang exec
433+
#' @keywords internal
433434
make_fn_dmt_tbl <- function (fns_path_chr, fns_dir_chr = make_undmtd_fns_dir_chr(),
434435
custom_dmt_ls = list(title_ls = NULL, desc_ls = NULL, details_ls = NULL,
435436
inc_for_main_user_lgl_ls = NULL, output_ls = NULL, example_ls = NULL,
@@ -866,13 +867,14 @@ make_obj_lup <- function ()
866867
{
867868
obj_tb <- tibble::tibble(short_name_chr = c("df", "fn", "ls",
868869
"r3", "r4", "s3", "s4", "sf", "tb", "arr", "chr", "dbl",
869-
"fct", "int", "lgl", "lup", "mat", "rgx"), long_name_chr = c("data.frame",
870-
"function", "list", "ready4 S3", "ready4 S4", "S3", "S4",
871-
"simple features object", "tibble", "array", "character",
872-
"double", "factor", "integer", "logical", "lookup table",
873-
"matrix", "regular expression"), atomic_element_lgl = c(rep(F,
874-
10), rep(T, 2), F, rep(T, 2), rep(F, 2), T), r3_element_lgl = c(T,
875-
F, T, rep(F, 4), rep(T, 11)))
870+
"dtm", "fct", "int", "lgl", "lup", "mat", "mdl", "prsns",
871+
"rgx"), long_name_chr = c("data.frame", "function", "list",
872+
"ready4 S3", "ready4 S4", "S3", "S4", "simple features object",
873+
"tibble", "array", "character", "double", "date", "factor",
874+
"integer", "logical", "lookup table", "matrix", "model",
875+
"persons", "regular expression"), atomic_element_lgl = c(rep(F,
876+
10), rep(T, 6), rep(F, 4), T), r3_element_lgl = c(T,
877+
F, T, rep(F, 4), rep(T, 14)))
876878
obj_tb <- dplyr::bind_rows(obj_tb %>% dplyr::mutate(long_name_chr = purrr::map2_chr(long_name_chr,
877879
atomic_element_lgl, ~ifelse(.y, paste0(.x, " vector"),
878880
.x))), obj_tb %>% dplyr::filter(atomic_element_lgl) %>%
@@ -903,7 +905,7 @@ make_obj_lup <- function ()
903905
#' @param pkg_nm_1L_chr Package name (a character vector of length one), Default: get_dev_pkg_nm()
904906
#' @param pkg_title_1L_chr Package title (a character vector of length one)
905907
#' @param pkg_desc_1L_chr Package description (a character vector of length one)
906-
#' @param authors_prsns PARAM_DESCRIPTION
908+
#' @param authors_prsns Authors (a persons)
907909
#' @param urls_chr Urls (a character vector)
908910
#' @return Package description (a list)
909911
#' @rdname make_pkg_desc_ls

R/fn_read.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#' @rdname read_fns
66
#' @export
77
#' @importFrom purrr walk
8+
#' @keywords internal
89
read_fns <- function (fns_dir_1L_chr = "data-raw/fns/")
910
{
1011
fns_path_chr <- list.files(fns_dir_1L_chr, pattern = "*.R$",

R/fn_rowbind.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#' @export
99
#' @importFrom purrr reduce
1010
#' @importFrom methods getSlots
11+
#' @keywords internal
1112
rowbind_all_tbs_in_r4_obj <- function (tbs_r4, second_tbs_r4, r4_name_1L_chr)
1213
{
1314
tbs_r4 <- purrr::reduce(methods::getSlots(r4_name_1L_chr) %>%

R/fn_write.R

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ write_abbr_lup <- function (short_name_chr = NA_character_, long_name_chr = NA_c
2828
}
2929
pkg_dss_tb <- update_abbr_lup(seed_lup, short_name_chr = short_name_chr,
3030
long_name_chr = long_name_chr, no_plural_chr = no_plural_chr,
31-
custom_plural_ls = custom_plural_ls) %>% write_and_doc_ds(db = .,
31+
custom_plural_ls = custom_plural_ls) %>% write_and_doc_ds(db_df = .,
3232
overwrite_1L_lgl = overwrite_1L_lgl, db_1L_chr = "abbreviations_lup",
3333
title_1L_chr = "Common abbreviations lookup table", desc_1L_chr = paste0("A lookup table for abbreviations commonly used in object names in the ",
3434
pkg_nm_1L_chr, "package."), format_1L_chr = "A tibble",
@@ -46,6 +46,7 @@ write_abbr_lup <- function (short_name_chr = NA_character_, long_name_chr = NA_c
4646
#' @export
4747
#' @importFrom purrr walk
4848
#' @importFrom methods getSlots
49+
#' @keywords internal
4950
write_all_tbs_in_tbs_r4_to_csvs <- function (tbs_r4, r4_name_1L_chr, lup_dir_1L_chr, pfx_1L_chr)
5051
{
5152
purrr::walk(methods::getSlots(r4_name_1L_chr) %>% names(),
@@ -55,7 +56,7 @@ write_all_tbs_in_tbs_r4_to_csvs <- function (tbs_r4, r4_name_1L_chr, lup_dir_1L_
5556
}
5657
#' Write and document dataset
5758
#' @description write_and_doc_ds() is a Write function that writes a file to a specified local directory. Specifically, this function implements an algorithm to write and document dataset. The function returns Package datasets (a tibble).
58-
#' @param db PARAM_DESCRIPTION
59+
#' @param db_df Database (a data.frame)
5960
#' @param overwrite_1L_lgl Overwrite (a logical vector of length one), Default: T
6061
#' @param db_1L_chr Database (a character vector of length one)
6162
#' @param title_1L_chr Title (a character vector of length one)
@@ -75,7 +76,7 @@ write_all_tbs_in_tbs_r4_to_csvs <- function (tbs_r4, r4_name_1L_chr, lup_dir_1L_
7576
#' @importFrom tibble tibble add_case
7677
#' @importFrom utils data
7778
#' @importFrom devtools document load_all
78-
write_and_doc_ds <- function (db, overwrite_1L_lgl = T, db_1L_chr, title_1L_chr,
79+
write_and_doc_ds <- function (db_df, overwrite_1L_lgl = T, db_1L_chr, title_1L_chr,
7980
desc_1L_chr, format_1L_chr = "A tibble", url_1L_chr = NA_character_,
8081
vars_ls = NULL, R_dir_1L_chr = "R", simple_lup_1L_lgl = F,
8182
abbreviations_lup = NULL, object_type_lup = NULL, pkg_dss_tb = tibble::tibble(ds_obj_nm_chr = character(0),
@@ -87,11 +88,11 @@ write_and_doc_ds <- function (db, overwrite_1L_lgl = T, db_1L_chr, title_1L_chr,
8788
if (is.null(object_type_lup))
8889
utils::data("object_type_lup", package = "ready4fun",
8990
envir = environment())
90-
eval(parse(text = paste0(db_1L_chr, "<-db")))
91+
eval(parse(text = paste0(db_1L_chr, "<-db_df")))
9192
eval(parse(text = paste0("usethis::use_data(", db_1L_chr,
9293
", overwrite = overwrite_1L_lgl)")))
9394
sink(paste0(R_dir_1L_chr, "/db_", db_1L_chr, ".R"), append = F)
94-
write_ds_dmt(db = db, db_1L_chr = db_1L_chr, title_1L_chr = title_1L_chr,
95+
write_ds_dmt(db_df = db_df, db_1L_chr = db_1L_chr, title_1L_chr = title_1L_chr,
9596
desc_1L_chr = desc_1L_chr, format_1L_chr = format_1L_chr,
9697
vars_ls = vars_ls, url_1L_chr = url_1L_chr, R_dir_1L_chr = R_dir_1L_chr,
9798
simple_lup_1L_lgl = simple_lup_1L_lgl, abbreviations_lup = abbreviations_lup,
@@ -225,7 +226,7 @@ write_documented_fns <- function (tmp_fn_dir_1L_chr, R_dir_1L_chr)
225226
}
226227
#' Write dataset documentation
227228
#' @description write_ds_dmt() is a Write function that writes a file to a specified local directory. Specifically, this function implements an algorithm to write dataset documentation. 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
228-
#' @param db PARAM_DESCRIPTION
229+
#' @param db_df Database (a data.frame)
229230
#' @param db_1L_chr Database (a character vector of length one)
230231
#' @param title_1L_chr Title (a character vector of length one)
231232
#' @param desc_1L_chr Description (a character vector of length one)
@@ -243,7 +244,7 @@ write_documented_fns <- function (tmp_fn_dir_1L_chr, R_dir_1L_chr)
243244
#' @importFrom purrr map map2 pluck map2_chr
244245
#' @importFrom stats setNames
245246
#' @keywords internal
246-
write_ds_dmt <- function (db, db_1L_chr, title_1L_chr, desc_1L_chr, format_1L_chr = "A tibble",
247+
write_ds_dmt <- function (db_df, db_1L_chr, title_1L_chr, desc_1L_chr, format_1L_chr = "A tibble",
247248
url_1L_chr = NA_character_, vars_ls = NULL, R_dir_1L_chr = "R",
248249
simple_lup_1L_lgl = F, abbreviations_lup = NULL, object_type_lup = NULL)
249250
{
@@ -253,11 +254,11 @@ write_ds_dmt <- function (db, db_1L_chr, title_1L_chr, desc_1L_chr, format_1L_ch
253254
if (is.null(object_type_lup))
254255
utils::data("object_type_lup", package = "ready4fun",
255256
envir = environment())
256-
auto_vars_ls <- names(db) %>% purrr::map(~ifelse(simple_lup_1L_lgl,
257+
auto_vars_ls <- names(db_df) %>% purrr::map(~ifelse(simple_lup_1L_lgl,
257258
get_from_lup_obj(abbreviations_lup, target_var_nm_1L_chr = "long_name_chr",
258259
match_var_nm_1L_chr = "short_name_chr", match_value_xx = .x,
259260
evaluate_lgl = F), make_arg_desc(.x, object_type_lup = object_type_lup,
260-
abbreviations_lup = abbreviations_lup))) %>% stats::setNames(names(db))
261+
abbreviations_lup = abbreviations_lup))) %>% stats::setNames(names(db_df))
261262
if (is.null(vars_ls)) {
262263
vars_ls <- auto_vars_ls
263264
}
@@ -469,7 +470,6 @@ write_inst_dir <- function (path_to_pkg_rt_1L_chr = getwd())
469470
#' @rdname write_links_for_website
470471
#' @export
471472

472-
#' @keywords internal
473473
write_links_for_website <- function (path_to_pkg_rt_1L_chr = getwd(), user_manual_url_1L_chr = NA_character_,
474474
developer_manual_url_1L_chr = NA_character_, project_website_url_1L_chr = NA_character_)
475475
{
@@ -557,6 +557,7 @@ write_new_arg_sfxs <- function (arg_nms_chr, fn_type_1L_chr, dir_path_chr, rt_de
557557
#' @importFrom purrr map_chr discard walk
558558
#' @importFrom stringr str_replace str_sub str_locate
559559
#' @importFrom usethis use_dev_package use_package use_version
560+
#' @keywords internal
560561
write_ns_imps_to_desc <- function (dev_pkgs_chr = NA_character_, incr_ver_1L_lgl = T)
561562
{
562563
devtools::document()
@@ -588,6 +589,7 @@ write_ns_imps_to_desc <- function (dev_pkgs_chr = NA_character_, incr_ver_1L_lgl
588589
#' @importFrom utils packageDescription
589590
#' @importFrom purrr map_chr
590591
#' @importFrom stringr str_replace_all
592+
#' @keywords internal
591593
write_pkg <- function (package_1L_chr, R_dir_1L_chr = "R")
592594
{
593595
write_from_tmp(system.file("pkg_ready_fun.R", package = "ready4fun"),
@@ -610,7 +612,7 @@ write_pkg <- function (package_1L_chr, R_dir_1L_chr = "R")
610612
#' @param path_to_pkg_rt_1L_chr Path to package root (a character vector of length one), Default: getwd()
611613
#' @param dev_pkg_nm_1L_chr Development package name (a character vector of length one), Default: get_dev_pkg_nm(getwd())
612614
#' @param incr_ver_1L_lgl Incr ver (a logical vector of length one), Default: T
613-
#' @param delete_contents_of_R_dir PARAM_DESCRIPTION, Default: F
615+
#' @param delete_r_dir_cnts_1L_lgl Delete r directory contents (a logical vector of length one), Default: F
614616
#' @param copyright_holders_chr Copyright holders (a character vector)
615617
#' @param check_type_1L_chr Check type (a character vector of length one), Default: 'none'
616618
#' @param add_gh_site_1L_lgl Add gh site (a logical vector of length one), Default: T
@@ -632,7 +634,7 @@ write_pkg <- function (package_1L_chr, R_dir_1L_chr = "R")
632634
#' @importFrom pkgdown build_favicons
633635
#' @importFrom dplyr filter
634636
write_pkg_setup_fls <- function (pkg_desc_ls, path_to_pkg_rt_1L_chr = getwd(), dev_pkg_nm_1L_chr = get_dev_pkg_nm(getwd()),
635-
incr_ver_1L_lgl = T, delete_contents_of_R_dir = F, copyright_holders_chr,
637+
incr_ver_1L_lgl = T, delete_r_dir_cnts_1L_lgl = F, copyright_holders_chr,
636638
check_type_1L_chr = "none", add_gh_site_1L_lgl = T, path_to_pkg_logo_1L_chr = NA_character_,
637639
github_repo_1L_chr, lifecycle_stage_1L_chr = "experimental",
638640
badges_lup = NULL, addl_badges_ls = NULL)
@@ -642,7 +644,7 @@ write_pkg_setup_fls <- function (pkg_desc_ls, path_to_pkg_rt_1L_chr = getwd(), d
642644
if (is.null(badges_lup)) {
643645
utils::data("badges_lup", envir = environment())
644646
}
645-
if (delete_contents_of_R_dir)
647+
if (delete_r_dir_cnts_1L_lgl)
646648
write_to_reset_pkg_files(delete_contents_of_1L_chr = "R",
647649
package_1L_chr = dev_pkg_nm_1L_chr, package_dir_1L_chr = path_to_pkg_rt_1L_chr)
648650
update_desc_fl_1L_lgl <- !is.na(dev_pkg_nm_1L_chr)
@@ -756,6 +758,7 @@ write_pt_lup_db <- function (R_dir_1L_chr = "R")
756758
#' @rdname write_std_imp
757759
#' @export
758760

761+
#' @keywords internal
759762
write_std_imp <- function (R_dir_1L_chr = "R")
760763
{
761764
write_from_tmp(system.file("imp_pipe_tmp.R", package = "ready4fun"),
@@ -777,6 +780,7 @@ write_std_imp <- function (R_dir_1L_chr = "R")
777780
#' @importFrom dplyr mutate_if funs
778781
#' @importFrom stringr str_c
779782
#' @importFrom utils write.csv
783+
#' @keywords internal
780784
write_tb_to_csv <- function (tbs_r4, slot_nm_1L_chr, r4_name_1L_chr, lup_dir_1L_chr,
781785
pfx_1L_chr)
782786
{
@@ -871,6 +875,7 @@ write_to_replace_sfx_pair <- function (args_nm_chr, sfxs_chr, replacements_chr,
871875
#' @importFrom devtools load_all document
872876
#' @importFrom utils packageDescription
873877
#' @importFrom usethis use_description
878+
#' @keywords internal
874879
write_to_reset_pkg_files <- function (delete_contents_of_1L_chr, package_1L_chr = get_dev_pkg_nm(getwd()),
875880
package_dir_1L_chr = getwd(), description_ls = NULL, keep_version_lgl = T)
876881
{

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## Standardised Function Authoring and Documentation Tools for Use with the Ready4 Suite
44

55
<!-- badges: start -->
6+
[![R-CMD-check](https://github.com/ready4-dev/ready4fun/workflows/R-CMD-check/badge.svg)](https://github.com/ready4-dev/ready4fun/actions)
7+
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
8+
[![ready4](https://img.shields.io/badge/ready4-authoring-maroon?style=flat&labelColor=black&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABdUlEQVQ4T42TO0gDQRCGv3tsLqawEwtBsbOws7ExIIrYi02sLATBUkFQrG1E8IEPUOwsLMS0Wola2AiawkcZLG2SQnNe7kY2dyHhzEW32WLm//af2RmjVEBwwXyBYABwaHuMIiAgfWGaUXpE0jkwnyEYBHc9WW8+gbMWAtwN8Mc14A7JjEQiIwxIggs7D/ZVmFvNwfeyBhQQtQv2KVRnwFtoOLBPwB8D6Y3sFsFZAqMMlX2Q/gigwzVAriFWO6COQLqhou8IojOsU/Cj3JqDOEBtgzpuwOKQtoD6y/FWNkMSAdIJzmryLwR9UDkH6yyphGlwFsG6/g2RNLhbEAz/1QPvN6RZ/K8m0gSJi1sCrEtQB+DNgz8R2fcgtQLVqdB27ZQhtQnmG3hz4I/qObhHMlnQr6Lg8xZIt26k2gN12Jjar7wGPCAdk2B8gHSBN6s3pDXAfAX7Ig4oIMY7WDfgZ0F62iyjgHUFeqmCoXoJ0SS2X+Lk6A8CAbAFEGOxOgAAAABJRU5ErkJggg==)](https://www.ready4-dev.com/toolkits/)
69
<!-- badges: end -->
710

811
ready4fun is a collection of functions for authoring code

_pkgdown.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
home:
2-
links:
3-
- text: User manual (PDF)
4-
href: https://github.com/ready4-dev/ready4fun/releases/download/v0.0.0.9270/ready4fun_0.0.0.9270.pdf
5-
- text: Project website
6-
href: https://www.ready4-dev.com/
71
development:
82
mode: auto
93
reference:
@@ -17,25 +11,16 @@ reference:
1711
- title: "Functions"
1812
- contents:
1913
- get_from_lup_obj
20-
- import_xls_sheets
2114
- make_dmt_for_all_fns
22-
- make_fn_dmt_tbl
2315
- make_fn_type_lup
2416
- make_lines_for_fn_dmt
25-
- read_fns
26-
- rowbind_all_tbs_in_r4_obj
2717
- write_abbr_lup
28-
- write_all_tbs_in_tbs_r4_to_csvs
2918
- write_and_doc_ds
3019
- write_and_doc_fn_fls
3120
- write_dmtd_fn_type_lup
3221
- write_documented_fns
3322
- write_fn_type_dirs
34-
- write_ns_imps_to_desc
35-
- write_pkg
23+
- write_links_for_website
3624
- write_pkg_setup_fls
3725
- write_pt_lup_db
38-
- write_std_imp
39-
- write_tb_to_csv
40-
- write_to_reset_pkg_files
4126
- write_ws

0 commit comments

Comments
 (0)