# NOT RUN {
# First example
# Enter a string of arbritary of "a","a","y","n"
# Result:
# [1] a
# Levels: a b n y
decision_modus(c("a","a","y","n","b"))
# Second example
# Analyze data from the decision_res_testdat.csv data file
filename <- system.file("decision_res_testdat.csv", package = "PCRedux")
my_data <- read.csv(filename)
head(my_data)
dec <- unlist(lapply(1L:nrow(my_data), function(i) {
decision_modus(my_data[i, 2:4])
}))
names(dec) <- my_data[, 1]
dec
# }
Run the code above in your browser using DataLab