We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to do this without rendering a .rmd? I found this code but couldn't figure out how to apply it:
.rmd
tempDir <- tempfile() dir.create(tempDir) htmlFile <- file.path(tempDir, "index.html") # (code to write some content to the file) viewer <- getOption("viewer") viewer(htmlFile)
tempDir <- tempfile()
dir.create(tempDir)
htmlFile <- file.path(tempDir, "index.html")
# (code to write some content to the file)
viewer <- getOption("viewer")
viewer(htmlFile)
The text was updated successfully, but these errors were encountered:
The main constraint, for security reasons, is that RStudio's Viewer will only open files below the session temp directory.
But maybe @kevinushey can weigh in to correct or refine this.
Sorry, something went wrong.
That is indeed correct.
Does this mean that it can't be done?
You can do it, but you need to copy the file(s) into tempdir() and then open them from there with the function returned by getOption("viewer").
tempdir()
getOption("viewer")
No branches or pull requests
Is there a way to do this without rendering a
.rmd
? I found this code but couldn't figure out how to apply it:tempDir <- tempfile()
dir.create(tempDir)
htmlFile <- file.path(tempDir, "index.html")
# (code to write some content to the file)
viewer <- getOption("viewer")
viewer(htmlFile)
The text was updated successfully, but these errors were encountered: