[R] outputs of a function

Arnaud Michel michel.arnaud at cirad.fr
Thu Dec 4 11:09:12 CET 2014


Hello

I have a function named FctModele13 in which
1) I calculate a dataframe named Total and
2) I used ggplot2.
I have the following problem. I cannot produce simultaneously

  * the graphic by ggplot2
  * the dataframe

My simplified code is the following one :


TT <- FctModele13(ListePlusde50ans, PourcentSexeCsp, NbAn=10)
FctModele <- function(ListePlusde50ans, PourcentSexeCsp, NbAn)
{
# calculate Total
.....
.....
Total <- data.frame(....)
###################
# plot by ggplot
library(ggplot2)
ggplot(.....) +
......
axis.title.y = element_text(size = 8)) +
labs(title="Title")

Total
}



Any idea ?

-- 
Michel ARNAUD
CIRAD Montpellier
tel : 04.67.61.75.38
port: 06.47.43.55.31


	[[alternative HTML version deleted]]



More information about the R-help mailing list