r - error with lapply on anonymous ggplot function -


i'm trying use lapply on ggplot anonymous function

if (inputmethodp=="withinfile")                     {                         par(mfrow=c(5,listportions))                             plotlist<-lapply(rangestatresultp, function(listpart)                         {                                   ggplot(matrixpart, aes(x = factor(var2), y=value)) + geom_violin()+                                 ggtitle(names(listpart)+xlab(listnum)+ylab("coverage")+                                 stat_summary(fun.y = median, geom = "point", position = position_dodge(width = .9),                                 size = 6, shape = 4, show_guide = f)                         })                       } 

when ever insert chunk of code script gives
me error

error: unexpected '}' in: "                                         size = 6, shape = 4, show_guide = f)     }" 

is syntax wrong? can't seem hunt down whatever stray { causing this.

you missing paranthesis close ggtitle() names() requires closing paren.

if (inputmethodp == "withinfile") {   par(mfrow = c(5, listportions))   plotlist <- lapply(rangestatresultp, function(listpart) {     ggplot(matrixpart, aes(x = factor(var2), y = value)) +       geom_violin()+       ggtitle(names(listpart)) +       xlab(listnum) +       ylab("coverage") +       stat_summary(fun.y = median, geom = "point",                    position = position_dodge(width = .9), size = 6, shape = 4,                    show_guide = f)   }) } 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -