Hi,
I have downloaded a R script from
http://www.wessa.net/rwasp_edauni.wasp#output.
This script produces a densityplot graphic, amongst others, when is
executed from the web page.
However, when I run it in my machine the *densityplot* function produces
any output, I mean a blank graphic.
But, it's interesting if I run the following lines in the R interactive
console:
> y <- as.ts(x$pending)
> bitmap(file="tmp")
> densityplot(~y,col="black",main="x")
> dev.off()
Basically, they are the same lines inside the script, I got the expected
output.
I appreciate you advice,
The script code:
totalgraphics <- function(server,status) {
par2 = '0'
par1 = '0'
filename <- paste(server,status,sep='.')
filename <- paste('./pre-processed/',filename,sep='')
v <- read.csv(file=filename,sep=',')
x <- v[[status]]
par1 <- as.numeric(par1)
par2 <- as.numeric(par2)
x <- as.ts(x)
library(lattice)
filename <-
paste(server,'_',status,'-','density','.png',sep='')
bitmap(file=filename)
title <- paste('Density Plot bw = ',par1,' for
',server,'[',status,']',sep=' ')
*if (par1 == 0)
{
densityplot(~x,col='black',main=title)
} else {
if (par1 > 0) {
densityplot(~x,col='black',main=title,bw=par1)
}
}*
dev.off()
filename <-
paste(server,'_',status,'-','sequence','.png',sep='')
bitmap(file=filename)
title <- paste('Run Sequence Plot
for',server,'[',status,']',sep=' ')
plot(x,type='l',main=title,xlab='time or
index',ylab='value')
grid()
dev.off()
filename <-
paste(server,'_',status,'-','hist','.png',sep='')
bitmap(file=filename)
hist(x)
grid()
dev.off()
filename <-
paste(server,'_',status,'-','quantile','.png',sep='')
bitmap(file=filename)
qqnorm(x)
qqline(x)
grid()
dev.off()
if (par2 > 0)
{
filename <-
paste(server,'_',status,'-','lagplot1','.png',sep='')
bitmap(file=filename)
dum <- cbind(lag(x,k=1),x)
dum
dum1 <- dum[2:length(x),]
dum1
z <- as.data.frame(dum1)
z
title <- paste('Lag plot (k=1), lowess, and regression line for
',server,'[',status,']',sep=' ')
plot(z,main=title)
lines(lowess(z))
abline(lm(z))
dev.off()
if (par2 > 1) {
filename <-
paste(server,'_',status,'-','lagplot2','.png',sep='')
bitmap(file=filename)
dum <- cbind(lag(x,k=par2),x)
dum
dum1 <- dum[(par2+1):length(x),]
dum1
z <- as.data.frame(dum1)
z
mylagtitle <- 'Lag plot (k='
mylagtitle <- paste(mylagtitle,par2,sep='')
mylagtitle <- paste(mylagtitle,'), and lowess',sep='')
title <- paste(mylagtitle,' for
',server,'[',status,']',sep=' ')
plot(z,main=title)
lines(lowess(z))
dev.off()
}
filename <-
paste(server,'_',status,'-','autocorre','.png',sep='')
bitmap(file=filename)
title <- paste('Autocorrelation Function',' for
',server,'[',status,']',sep=' ')
acf(x,lag.max=par2,main=title)
grid()
dev.off()
}
summary(x);
}
servers <-
c("komolongma.ece.uprm.edu","sakura.hpcc.jp","fsvc001.asc.hpcc.jp","rocks-52.sdsc.edu","rocks-153.sdsc.edu")
status <- c("unsubmitted","active","pending")
for (i in servers) {
for (j in status) {
totalgraphics(i,j)
}
}
[[alternative HTML version deleted]]