Skip to content

Commit

Permalink
Update parse_formula.R
Browse files Browse the repository at this point in the history
  • Loading branch information
n8thangreen authored Dec 13, 2023
1 parent cc998f7 commit feaab97
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions R/parse_formula.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ get_treatment_name <- function(formula) {

#' Get mean names
#'
#' @param dat Data
#' @template args-ald
#' @param var_names Variable names
#'
#' @return Mean names
#' @return Mean names vector
#' @keywords internal
#'
get_mean_names <- function(dat, var_names) {
dat_names <- names(dat)
get_mean_names <- function(ald, var_names) {
dat_names <- names(ald)
# is_sd_name <- grepl(pattern = "\\.mean", dat_names)
is_mean_name <- grepl(pattern = "mean\\.", dat_names)
is_var_name <- grepl(pattern = paste(var_names, collapse = "|"), dat_names)

dat_names[is_mean_name & is_var_name]
}

#' Get SD names
#' Get standard deviation names
#'
#' @param dat
#' @template args-ald
#' @param var_names
#'
#' @return SD names
#' @return Standard deviation names vector
#' @keywords internal
#'
get_sd_names <- function(dat, var_names) {
dat_names <- names(dat)
get_sd_names <- function(ald, var_names) {
dat_names <- names(ald)
# is_sd_name <- grepl(pattern = "\\.sd", dat_names)
is_sd_name <- grepl(pattern = "sd\\.", dat_names)
is_var_name <- grepl(pattern = paste(var_names, collapse = "|"), dat_names)
Expand All @@ -71,7 +71,7 @@ get_sd_names <- function(dat, var_names) {
#'
#' @param formula Linear regression formula
#'
#' @return covariate names
#' @return covariate names vector
#' @keywords internal
#'
get_covariate_names <- function(formula) {
Expand Down

0 comments on commit feaab97

Please sign in to comment.