Good day All,
The following code throws an error when using panel.margin.
It works fine otherwise.
I was just trying to get more white space between facets.
Any hint on what I am doing wrong appreciated,
Thanks, JL
> indivplot <- function (x){
+ p <- ggplot(subset(zm, subj == x ), aes(daycycle, value))
+ p + geom_point(aes(x=daycycle,y=value, colour = ovul), size= 3) +
+ facet_grid(variable~., scales="free_y") +
+ scale_x_continuous(breaks = seq(3, 40, 5),limits=c(3, 40) ) +
+ labs(title= paste("Subject", as.character(x), sep=":")) +
+ theme(plot.title = element_text(colour = "blue"), panel.margin = unit(2, "lines"),
+ strip.text = element_text(colour = "blue", size = 14,
+ face = "bold.italic", hjust = 0.5, vjust = 0.5))
+
+ ggsave(file=paste("subject", as.character(x),"pdf", sep="."))
+ }
> z <- w[!is.na(w$site),]
> zm <- melt(z, id.vars= c("subj", "site", "daycycle", "ovul" ),
+ measure.vars = c("folsiz", "estro", "progest", "hooghra"))
> allsubj <- as.list(unique(w$subj))
> lapply(allsubj,indivplot)
Erreur dans theme(plot.title = element_text(colour = "blue"), panel.margin = unit(0, :
impossible de trouver la fonction "unit"