prodplot and labels

17 views
Skip to first unread message

neuwirthe

unread,
Mar 24, 2017, 10:30:34 AM3/24/17
to ggplot2
There is a problem with prodplot (from productplots)
with labels derived from variables with spaces in the variable name

library(productplots)
data
(happy)
happy1
<- mutate(happy,`marital status` = marital)
prodplot
(happy1, ~ health + marital)
prodplot
(happy1,~ health + `marital status`)
prodplot
(happy1,~ health + `marital status`,c("vspine","hspine"))
prodplot
(happy1, ~ health + sex + marital,c("vspine","hspine","hspine"))
prodplot
(happy1, ~ health + sex + `marital status`,c("vspine","hspine","hspine"))

All plots but the last one word, so in principle prodplot can deal with spaces in variable names.
The last plot produces an error
Error in `[.data.frame`(labels, x, col) : undefined columns selected

I suspect that producing the x-axis-label which concatenates two variable labels
has a problem.


neuwirthe

unread,
Mar 24, 2017, 7:27:48 PM3/24/17
to ggplot2
I just noticed: even when prodplot prints the axis title containing spaces, it will not display the axis tick mark labels in that case.
Reply all
Reply to author
Forward
0 new messages