check.ordered.one.var: Verify if one specific variable of a data set is an ordered...

Description Usage Arguments Value Author(s) References Examples

View source: R/check.ordered.one.var.R

Description

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.

Usage

1
check.ordered.one.var(data.to.work, var.name)

Arguments

data.to.work

is a data set containing the variables to be checked.

var.name

is the name of variable to be checked.

Value

TRUE or FALSE

Author(s)

Elias Carvalho

References

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.

Examples

 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)

bnpa documentation built on Aug. 2, 2019, 1:05 a.m.