ggstatsplot (version 0.0.6)

signif_column: Creating a new character type column with significance labels

Description

This function will add a new column to a dataframe containing p-values

Usage

signif_column(data = NULL, p)

Arguments

data

Data frame from which variables specified are preferentially to be taken.

p

The column containing p-values.

Value

Returns the originally entered object (either a vector or a dataframe) in tibble format with an additional column corresponding to statistical significance.

See Also

Other helper_stats: check_outlier, grouped_proptest, untable

Examples

Run this code
# NOT RUN {
# vector as input
signif_column(p = c(0.05, 0.1, 1, 0.00001, 0.001, 0.01))

# dataframe as input
# preparing a newdataframe
df <- tibble(
  x = 1:5,
  y = 1,
  p.value = c(0.1, 0.5, 0.00001, 0.05, 0.01)
)

signif_column(data = df, p = p.value)

# numbers entered as characters are also tolerated
signif_column(p = c("1", "0.1", "0.0002", "0.03", "0.65"))
# }

Run the code above in your browser using DataCamp Workspace