with_connection | R Documentation |
R file connections which are automatically closed.
with_connection(con, code)
local_connection(con, .local_envir = parent.frame())
con |
For |
code |
|
.local_envir |
|
[any]
The results of the evaluation of the code
argument.
withr
for examples
with_connection(list(con = file("foo", "w")), {
writeLines(c("foo", "bar"), con)
})
read_foo <- function() {
readLines(local_connection(file("foo", "r")))
}
read_foo()
unlink("foo")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.