I have a data.table I'm trying to plot facets with ggplot and I'm getting the error listed below. Thanks in advance for any help.
require(data.table, ggplot2)
dt <- as.data.table(read.table(h=T,
text="ROW mode resbin V1
0 RD 50.0 0
1 RD 50.0 0
2 RD 50.0 0
0 RD 33.3 0
1 RD 33.3 0
1 PV 7.5 1
2 PV 7.5 0
0 PV 6.0 1
1 PV 6.0 1
2 PV 6.0 1"))
ggplot(dt, aes(x = factor(resbin), y = V1, group=1)) +
geom_point(aes(color=factor(mode)), size=3) +
geom_line() +
facet_wrap(~factor(ROW), ncol=2)
#Error in layout_base(data, vars, drop = drop) :
#At least one layer must contain all variables used for facetting