Browse Source

`check()` corrections

tags/0.1.0
Maxime Wack 7 years ago
parent
commit
953f5f6df4
5 changed files with 8 additions and 6 deletions
  1. +1
    -1
      DESCRIPTION
  2. +1
    -0
      NAMESPACE
  3. +3
    -3
      R/arg_functions.R
  4. +2
    -1
      R/utils.R
  5. +1
    -1
      man/parse_formula.Rd

+ 1
- 1
DESCRIPTION View File

@@ -9,7 +9,7 @@ Description: This package provides functions to easily create descriptive and
datatable or pander to integrate into reports.
Depends:
R (>= 3.2.3)
License: GPL-3
License: file LICENSE
Encoding: UTF-8
LazyData: true
Imports:


+ 1
- 0
NAMESPACE View File

@@ -7,6 +7,7 @@ export(Q3)
export(Range)
export(desctable)
export(list_normal)
export(parse_formula)
export(percent)
export(petrify)
export(stats_auto)


+ 3
- 3
R/arg_functions.R View File

@@ -12,7 +12,7 @@ stats_default <- function(data)
#' @export
stats_normal <- function(data)
{
list("N" = length, "Mean/%" = is.factor ~ percent | mean, "sd" = sd)
list("N" = length, "Mean/%" = is.factor ~ percent | mean, "sd" = stats::sd)
}

#' @rdname stats_default
@@ -44,9 +44,9 @@ stats_auto <- function(data)
else if (!fact & normal & nonnormal)
list("N" = length, "Mean" = is.normal ~ mean, "sd" = is.normal ~ sd, "Med" = is.normal ~ NA | median, "IQR" = is.normal ~ NA | IQR)
else if (!fact & normal & !nonnormal)
list("N" = length, "Mean" = mean, "sd" = sd)
list("N" = length, "Mean" = mean, "sd" = stats::sd)
else if (!fact & !normal & nonnormal)
list("N" = length, "Med" = median, "IQR" = IQR)
list("N" = length, "Med" = stats::median, "IQR" = IQR)
else
stats_default(data)
}

+ 2
- 1
R/utils.R View File

@@ -72,12 +72,13 @@ list_normal <- function(data)
#' @param x The variable to test it on
#' @param f A formula to parse
#' @return A function to use as a stat/test
#' @export
#' @examples
#' # To use one column for different statistics depending on the variable
#' parse_formula(is.factor ~ percent | (is.normal ~ mean | median), factor(rep(LETTERS[1:3], 5)))
#'
#' # To use one column selectively for a type of variable
#' parse_formula(is.normal ~ mean)
#' parse_formula(is.normal ~ mean, rnorm(1000))
parse_formula <- function(x, f)
{
parse_f <- function(x)


+ 1
- 1
man/parse_formula.Rd View File

@@ -31,5 +31,5 @@ The FALSE option can be omitted, and the TRUE can be replaced with NA
parse_formula(is.factor ~ percent | (is.normal ~ mean | median), factor(rep(LETTERS[1:3], 5)))

# To use one column selectively for a type of variable
parse_formula(is.normal ~ mean)
parse_formula(is.normal ~ mean, rnorm(1000))
}

Loading…
Cancel
Save