
Last chance! 50% off unlimited learning
Sale ends in
open a file using system2
with command based on operating system.
Tries to open the file with the program associated with its file extension.
See openPDF
to open files with sumatraPDF.
openFile(file, ...)
Filename to be opened, as character string.
Further arguments passed to system2
Result of try(system2, ...), invisibly
https://askubuntu.com/questions/15354, https://apple.stackexchange.com/questions/212583
# NOT RUN {
# excluded from CRAN checks, file opening not wanted
openFile("README.md")
openFile("Tests.R")
openFile(c("README.md","Tests.R"))
is.error(openFile("dummydummydoesntexist.R"), TRUE, TRUE)
openFile(tempdir())
# }
# NOT RUN {
#' # To open folders with system2:
# "nautilus" on linux ubuntu
# "open" or "dolphin" on mac
# "explorer" or "start" on windows
# }
Run the code above in your browser using DataLab