I am a beginner in R. For example i have a function called w whose code is listed below:
w<-function(x){
a<-x+2
plot(a)
}
How can i add these arguments in the function so that
Export: a number equal to 0 if result should be allowed on screen and to 1 if the result should be printed in a text file.
Tfile: name of the text file where the results will be written to;
Gfile:name of the pdf file where the graph will be written to.
function(x,export,tfile,gfile)?