r - Alter file.show() behaviour -
i'm running file.show()
in rstudio on mac, this:
filename <- "/users/me/reports/myfile.pdf" # replace file location/name file.show(file.path(filename), title="my file")
this 2 things:
opens file.pdf
opens blank file in rstudio called "my file".
options()$pdfviewer
returns:
"/usr/bin/open"
how can stop (2) happening?
if want open pdf file via rstudio on mac, simplest way (as far know) use system
function:
filename <- "/users/me/reports/myfile.pdf" pdf <- getoption("pdfviewer") # same options()$pdfviewer cmd <- paste(pdf,filename) system(cmd)
for example used openpdf
in biobase (see here)
i don't know way alter file.show
behaviour in order prevent blank file being opened in rstudio. think has the r.app mac os x gui uses internal pager irrespective of setting of pager.
can see on manual here.
note: different on windows machine, use shell.exec(filename)
directly.
Comments
Post a Comment