# \donttest{
library(dplyr)
# pps type is generic =======================================
pps_generic <- pps(iris)
pps_generic
# summary pps class
mat <- summary(pps_generic)
mat
# visualize pps class
plot(pps_generic)
# pps type is target_by =====================================
##-----------------------------------------------------------
# If the target variable is a categorical variable
categ <- target_by(iris, Species)
# compute all variables
pps_cat <- pps(categ)
pps_cat
# compute Petal.Length and Petal.Width variable
pps_cat <- pps(categ, Petal.Length, Petal.Width)
pps_cat
# Using dplyr
pps_cat <- iris %>%
target_by(Species) %>%
pps()
pps_cat
# Using parallel process
# pps_cat <- iris %>%
# target_by(Species) %>%
# pps(do_parallel = TRUE)
#
# pps_cat
# summary pps class
tab <- summary(pps_cat)
tab
# visualize pps class
plot(pps_cat)
##-----------------------------------------------------------
# If the target variable is a numerical variable
num <- target_by(iris, Petal.Length)
pps_num <- pps(num)
pps_num
# summary pps class
tab <- summary(pps_num)
tab
# plot pps class
plot(pps_num)
# }
Run the code above in your browser using DataLab