r - Running ggplot in script, saved variable and called print(). Plot window STILL not showing. -
i have following in script:
x <- as.numeric(colnames(sers$spectra)) y <- sers$spectra[1, ] require(ggplot2) emptydf <- data.frame() p <- ggplot(emptydf, aes(x=x, y=y)) p <- p + geom_line() print(p) message("press return continue") invisible(readlines("stdin", n=1)) when execute this, see:
$ rscript analyze.r loading required package: pls attaching package: ‘pls’ following object masked ‘package:stats’: loadings loading required package: ggplot2 loading required package: methods don't know how automatically pick scale object of type asis. defaulting continuous don't know how automatically pick scale object of type asis. defaulting continuous press return continue i've tried using in console , works. i've persisted output of ggplot() variable , tried print here.
i need last 2 lines otherwise script terminate. when execute this, don't see plot window. why?
Comments
Post a Comment