args1 = commandArgs(trailingOnly=TRUE)[1] IFN=paste(args1,".csv",sep="") OFN=paste(args1,".png",sep="") RT <- read.csv(IFN, header = TRUE) ts <- as.POSIXct(paste(RT$Date, RT$Time)) pwmin <- min(RT$Watt) pwmax <- max(RT$Watt) COMMENT=paste("Max:", pwmax,"W ,Min:", pwmin, "W") png(OFN, width = 800, height = 400) plot(ts,RT$Watt,type='l',ylim=c(0,150),xlab="time",ylab="Power(W)") mtext(COMMENT, side=3, line=0) dev.off()