Learn R Programming

EGAnet (version 0.9.6)

node.redundant.names: Changes Variable Names to Descriptions for node.redundant Objects

Description

Using a key, this function changes the variable names in the node.redundant output to descriptions

Usage

node.redundant.names(node.redundant.obj, key)

Arguments

node.redundant.obj
key

Character vector. A vector with variable descriptions that correspond to the order of variables from the data used as input into the node.redundant function

Value

Returns a list:

redundant

Vectors nested within the list corresponding to redundant nodes with the name of object in the list

data

Returns original data

weights

Returns weights determine by weighted topological overlap or partial correlations

key

Returns original key

Examples

Run this code
# NOT RUN {
# obtain SAPA items
items <- psychTools::spi[,-c(1:10)]

# }
# NOT RUN {
# weighted topological overlap
redund <- node.redundant(items, method = "wTO", type = "adapt")

# partial correlation
redund <- node.redundant(items, method = "pcor", type = "adapt")

# check redundancies
key.ind <- match(colnames(items), as.character(psychTools::spi.dictionary$item_id))
key <- as.character(psychTools::spi.dictionary$item[key.ind])

# change names in redundancy output to questionnaire item description
named.nr <- node.redundant.names(redund, key)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab