Call plot() from an R script and get the graph in the output file?

Viewed 7376

I have created an R script that reads certain data from a file, calls the summary() method and then the plot() method.

But when I try to run the R script where the commands below are written, in the output file I get the summary, but not the graph.

When I run the following instructions in R manually, everything works perfectly, and I get both the summary and the graph.

Is there a way to get the graph in the output file?

m0<-read.csv(file="Myfile", head=FALSE, sep",")
var_m0<-c(m0$ V3)
summary(var_m0)
plot(var_m0)

Thanks!

1 Answers
Related