Hi

I'm trying to use mapply to generate graphs but I cant figure out how to
get the program to only save the graph to the array and not the other
output.

plt<-function (x,y) {
  p<-dfs[dfs$region==x,c("region",y)]
  colnames(p)<-c("v1","v2")

g<-ggplot(p,aes(v2))+geom_density(aes(x=v2,fill=v1))+geom_histogram(aes(y=..density..),alpha=.5)+
theme(legend.position="none")
  g<-g+xlab(x)
  return(g)

}
m<-mapply(FUN=plt,x=c("spot_001"),y=c("Cell.Median.CD3"))

So I just want the graphs (g) to be stored in m and none of the other
extraneous output. Thanks for your help!

Jeremy

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to