Couldn't figure out why panelmap would not work with my data. After debugging, I realized it was because my mat was a tibble rather than a dataframe. After converting to dataframe, it worked fine.
Here's the reprex:
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
mat = mtcars %>% arrange(cyl) %>% select(mpg, vs, am, gear) %>% as_tibble()
mat.type= c(2,1,1,1)
mat.col=list(am=c("white","black"), vs=c("white","black"), gear=c("yellow","orange","brown"), mpg=c("white", "darkred"))
tab=makepanel(gr=mtcars.sort$cyl, gr.name="cyl",gr.col=c("red","blue","green"), mat=mat, mat.col=mat.col, mat.type=mat.type, border=TRUE, legend=TRUE, get.pval=TRUE)
#> Error in makepanel(gr = mtcars.sort$cyl, gr.name = "cyl", gr.col = c("red", : could not find function "makepanel"