openFile {mmstat4}R Documentation

openFile

Description

The function attempts to open a file either in RStudio or in a text editor, depending on the environment. If the session is interactive, it tries to open the file in RStudio using rstudioapi::navigateToFile(). If RStudio is not available or the attempt fails, it opens the file in a text editor using utils::edit(). If the session is not interactive, it simply returns the contents of the file.

Usage

openFile(file, ...)

Arguments

file

character: name of the file

...

further parameters give to rstudioapi::navigateToFile() or utils::edit()

Value

invisibly the result from try(rstudioapi::navigateToFile(file)) or try(utils::edit(file)).

Examples

openFile(system.file("rstudio", "addins.dcf", package = "mmstat4"))

[Package mmstat4 version 0.2.1 Index]