q.push: create new job

Description Usage Arguments Value See Also Examples

View source: R/q.push.R

Description

Queue new job for rmarkdown path or code.

Usage

1
2
 jid <- q.push(name, script = "myRmarkdown.Rmd")
 q.run(jid)

Arguments

name

specify name of job. If NULL, JID used

script

path to your Rmarkdown script (i.e. /home/usrs/report/monthly.Rmd)

code

R code text if you prefer to use

wdir

specify where is job log root

params

knitr parameter for dynamic report (use R list object)

outputfile

if you want to save outputfile to specific location or name. Default, write it out to log/output.

Value

jid

unique job id number

See Also

q.run, q.schedule, q.dispatcher,q.ls

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
## Not run: 

message( 'q.push test ')
q.dispatcher(n=1)

# create new job rmarkdown template
q.new()

# save it to your location with file name. ie./tests/mytest.Rmd
jid <- q.push(name = "My Report Job",
              script='tests/mytest.Rmd')

q.ls(jid) # show your job queue status only
q.show()  # show current job queue
q.shutdown()

# to keep output
q.dispatcher(printq=FALSE)

# q.push automatically assign the output file name
jid <- q.push(script='tests/mytest.Rmd')
q.wait(jid) # wait all queue to be completed
q.ls(jid, view.output=TRUE)


jid <- q.push(name = "My Report Job",
              script='tests/mytest.Rmd',
              outputfile = 'Jan.Report.html')

q.wait(jid) # wait all queue to be completed


q.run(jid) # rerun same job

q.rm('outbox/*') # clean all outbox job

q.shutdown()



## End(Not run)

okux/qrmarkdown documentation built on Dec. 22, 2021, 4:17 a.m.