# Data from the EUROFAMCARE sample dataset
library(sjmisc)
data(efc)
# retrieve variable and value labels
varlabs <- get_label(efc)
# recveive first item of COPE-index scale
start <- which(colnames(efc) == "c82cop1")
# recveive last item of COPE-index scale
end <- which(colnames(efc) == "c90cop9")
# create data frame with COPE-index scale
mydf <- as.data.frame(efc[, c(start:end)])
colnames(mydf) <- varlabs[c(start:end)]
sjt.pca(mydf)
# auto-detection of labels
sjt.pca(efc[, c(start:end)])
Run the code above in your browser using DataLab