Description Usage Arguments Examples
Example which handles POST / PUT requests in worker procs.
1 |
app |
callback function |
port |
which port to run the httpd |
size |
number of worker processes |
preload |
character vector of packages to preload in the workers |
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
httpd(function(env){
library(lme4)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
str <- paste(capture.output(print(fm1)), collapse = "\n")
list(
status = 200,
body = paste("pid:", Sys.getpid(), "\n\n", str),
headers = c("Content-Type" = "text/plain")
)
}, preload = "lme4")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.