Browse Source

Add comments to flag code to update after deprecation of desctable

tags/0.3.0
Maxime Wack 2 years ago
parent
commit
d7fc1ccbda
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      R/build.R
  2. +1
    -1
      R/stats.R

+ 3
- 3
R/build.R View File

@@ -13,7 +13,7 @@ statColumn <- function(stat, data) {
# Apply one statified stat function to every variable in the data
# Return a simple vector for the column
# Statify checks types and output for the stat function. Returns a numeric vector or a character vector if needed.
if (length(stat) == 3)
if (length(stat) == 3) # remove after 1.0
warning("Conditional formulas are deprecated and will be removed in 1.0.0

purrr::map style formulas are used now.
@@ -37,7 +37,7 @@ For example, `is.normal ~ mean | median` becomes `~ if (is.normal(.)) mean(.) el
statTable <- function(data, stats) {
# If stats is a function, apply it to the data to obtain a list of stat functions
# Else use the function list as-is
if (is.function(stats)) stats = stats(data)
if (is.function(stats)) stats = stats(data) # remove after 1.0

# Compute a statColumn for every stat function in stats
# Assemble the result in a dataframe
@@ -111,7 +111,7 @@ testColumn <- function(df, tests, grp) {
# If there is an .auto element in the list of tests, apply the function as previously to select the relevant test
# If there is a .default element, use it as tests
# Else fall back on kruskal.test
if (is.function(tests)) {
if (is.function(tests)) { # remove after 1.0
ftests <- lapply(df, tests, factor(group))
tests <- ftests
} else if (!is.null(tests$.default)) ftests <- lapply(df, function(x){tests$.default})


+ 1
- 1
R/stats.R View File

@@ -18,7 +18,7 @@ statify <- function(x, f) {
x <- stats::na.omit(x)

## Deprecate conditional formula
if (length(f) == 3)
if (length(f) == 3) # remove after 1.0
f <- parse_formula(x, f)
else
f <- rlang::as_function(f)


Loading…
Cancel
Save