# node process executor
q.dispatcher<-function(jid, wdir=q.wd(), wait=TRUE )
{
message(" ** QWD Dispatcher ** ")
run.cmd <- sprintf(
"suppressMessages({require(qrmarkdown)})\n
x = q.setwd( wdir = '%s' )\n
ret <- q.run( jid = '%s' )",
wdir,jid)
tmpfile <- sprintf("%s/agent/%s", q.wd(),
basename(jid))
sink(file=tmpfile)
cat(run.cmd)
sink()
rscript.cmd <- sprintf('Rscript %s', tmpfile)
system(rscript.cmd, wait = wait) # done job
file.remove(tmpfile)
print(tmpfile)
return(basename(jid))
} # q.dispatcher
# q.push(code='ls()')
# INBOX <- q.ls('inbox')
# tmp= q.dispatcher(jid=INBOX$jid[1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.