Sometimes, the meaningful "reference" for a contrast plot is not the average value or the first factor, and the user might want to set a custom reference for the variable.
In the Air Quality dataset, for example, the right reference for the discretized heat could be the "Mild" instead of "Cool"; and the absence of wind (speed of 0) might make more sense for some people.
Sorry it took a while for me to merge your pull request, but I was busy with other projects. This is great -- thanks for the improvement! visreg_2.4.1, incorporating this change, is now headed to CRAN.
Sometimes, the meaningful "reference" for a contrast plot is not the average value or the first factor, and the user might want to set a custom reference for the variable.
In the Air Quality dataset, for example, the right reference for the discretized heat could be the "Mild" instead of "Cool"; and the absence of wind (speed of 0) might make more sense for some people.
I have written the few lines of code to handle these cases and I will send a pull request shortly (in case you think this is a worthwhile addition).
Thanks for the package!