%{}% | R Documentation |
This infix operator can be used to create a background job for a block of code in RStudio/Posit and, once completed, all objects created in the block of code are imported into the global environment.
lhs %{}% rhs
lhs |
not used, see details and examples |
rhs |
the block of code that you want to run |
You can use this infix operator in two different ways. Either you set the left-hand side to NULL
or you use the syntax
`%{}%` ({BlockOfCode})
prints the ID of the background job in the console and, once completed, the objects created in the block of code are imported into the global environment
# Can only be executed in Rstudio
## Not run:
NULL %{}% {
x = rnorm(1e7)
y = rnorm(1e7)
}
`%{}%` ({
x = rnorm(1e7)
y = rnorm(1e7)
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.