简体   繁体   中英

How to display figures using RScript?

I know RScript is non-interactive, but I would like to display figures without running into the R interactive console first (the same way as in python and java).

In other words, I am hoping to be able to run a single build command from command prompt or terminal that runs an R script and displays its figures.

Thanks.

If you are familiar with shiny you can build simple shinyApp to display file.png file in browser:

Rscript -e 'png("file.png"); plot(1:10); dev.off(); runApp("display_png_app")'

Good comment by @Ista: you don't need to use shiny, you can simply use browseURL("file.png") command instead runApp .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM