Description Usage Arguments Value Author(s) References Examples
View source: R/check.ordered.one.var.R
Receives a data set, the name of a specific variable and verify if it is an ordered factor or not. If 'yes' then the function return TRUE.
1 | check.ordered.one.var(data.to.work, var.name)
|
data.to.work |
is a data set containing the variables to be checked. |
var.name |
is the name of variable to be checked. |
TRUE or FALSE
Elias Carvalho
HAYES, A F; PREACHER, K J. Statistical mediation analysis with a multicategorical independent variable. British Journal of Mathematical and Statistical Psychology, v. 67, n. 3, p. 451-470, 2014.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Clean environment
closeAllConnections()
rm(list=ls())
# Set enviroment
# setwd("to your working directory")
# Load packages
library(bnpa)
# Use working data sets from package
data(dataQualiN)
head(dataQualiN)
# Transform variable A into ordered factor
dataQualiN$A <- ordered(dataQualiN$A)
# Check variable A and return TRUE
var.name <- "A"
check.ordered.one.var(dataQualiN, var.name)
# Check variable B and return FALSE
var.name <- "B"
check.ordered.one.var(dataQualiN, var.name)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.