Closed StevenCHowell closed 6 years ago
There should be nothing special about the output of gen_design, other than some values we store so you don't have to recompute them. Looks like there's just a bug where one of these values has to be recomputed.
An easy workaround is to just pass the design to eval_design()
and pass the output of that to plot_correlations()
.
library(dplyr)
expand.grid(f1=as.factor(c(1,-1)),f2=as.factor(c(1,-1))) -> cand
c_design = skpr::gen_design(cand,~.,12)
n_design = c_design %>% mutate(f1 = as.numeric(f1), f2 = as.numeric(f2))
n_design %>%
skpr::eval_design(~.,0.2) %>%
skpr::plot_correlations()
I created a design representing a discrete numeric factor instead as a categorical factor so that the design would include each level. After getting the design, I am using
mutate()
together withas.numeric()
to convert the strings used for the categorical levels into integers.When I try to plot the correlation map on the design with numeric factor levels, I get the following error regarding the data type
Is the original output from
gen_design()
a different data type? Any recommendations on converting the string factor levels to integers in a way that is compatible withplot_correlations()
?