Hi,
I have the following script:
---- t.R ---
grafica <- function() {
v <- read.csv('preprocessed/komolongma.ece.uprm.edu.active',sep=',')
x <- as.ts(v$active)
bitmap(file="output.png")
densityplot(~x,col='blue',main='Density Plot')
dev.off()
}
grafica()
---- t.R ---
When I "sourced" it from R prompt, it quietly runs. However the
"output.png" generated contains any visible data. I said that, because
the file is created and it has 2062 bytes.
--- execution ---
> library(lattice)
> source(file="t.R")
>
--- execution ---
Now, if I sequentially run the lines above in the R prompt, the
"output.png" file contains a graphical representation of the data.
--- execution 2 ----
> v <- read.csv('preprocessed/komolongma.ece.uprm.edu.active',sep=',')
> x <- as.ts(v$active)
> bitmap(file="output.png")
> densityplot(~x,col='blue',main='Density Plot')
> dev.off()
---- execution 2 ---
What is wrong with the densityplot function that produces any output
when is invoked from a script?
Someone has a script invoking the densityplot function?
Thanks a lot for your help.
______________________________________________
R-help@r-project.org mailing list
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.