Render your challenge R Markdown script to a HTML page.

publish(input = "challenge.rmd", output_file = "index.html",
  output_dir = dirname(input), quiet = FALSE, ...)

Arguments

input
string. name of the R Markdown input file
output_file
string. output file. If NULL then a default based on the name of the input file is chosen.
output_dir
string. output directory. Defaults to the directory of the input file. make sure that the output HTML file will be published online.
quiet
logical. deactivate text output.
...
further arguments to pass to render.

Value

The compiled document is written into the output file, and the path of the output file is returned.

Note

The rendering of HTML content provided by Dropbox will be discontinued from the 3rd October 2016 for Basic users and the 1st September 2017 for Pro and Business users. See https://www.dropbox.com/help/16. Alternatively, https://pages.github.com/ provide an easy HTML web publishing solution via a simple GitHub repository.

See also

render

Examples

path <- tempdir() wd <- setwd(path) new_challenge()
#> New challenge installed in: "/tmp/Rtmp7NoKFA" #> Next steps to complete the installation: #> 1. Replace the data files in the "data" subdirectory. #> 2. Replace the baseline predictions in "submissions/baseline". #> 3. Customize the template R Markdown file "challenge.rmd" as needed. #> 4. Create and share subdirectories in "submissions" for each team: #> rchallenge::new_team("team_foo", "team_bar", path=".", submissions_dir="submissions") #> 5. Render the HTML page: #> rchallenge::publish("./challenge.rmd") #> 6. Give the URL to "challenge.html" to the participants. #> 7. Automate the updates of the webpage. #> On Unix systems, you can setup the following line to your crontab using "crontab -e": #> 0 * * * * Rscript -e 'rchallenge::publish("/tmp/Rtmp7NoKFA/challenge.rmd")'
outdir = tempdir() publish(output_dir = outdir, output_options = list(self_contained = FALSE))
#> #> #> processing file: challenge.rmd
#> | | | 0% | |.. | 3% #> ordinary text without R code #> #> | |.... | 6% #> label: unnamed-chunk-1 (with options) #> List of 3 #> $ echo : logi FALSE #> $ message: logi FALSE #> $ warning: logi FALSE #> #> | |...... | 9% #> inline R code fragments #> #> | |....... | 11% #> label: unnamed-chunk-2 (with options) #> List of 2 #> $ echo : logi FALSE #> $ results: chr "asis" #> #> | |......... | 14% #> ordinary text without R code #> #> | |........... | 17% #> label: unnamed-chunk-3 (with options) #> List of 2 #> $ echo : logi FALSE #> $ results: chr "asis" #> #> | |............. | 20% #> inline R code fragments #> #> | |............... | 23% #> label: unnamed-chunk-4 (with options) #> List of 1 #> $ eval: logi FALSE #> #> | |................. | 26% #> ordinary text without R code #> #> | |................... | 29% #> label: unnamed-chunk-5 #> | |.................... | 31% #> inline R code fragments #> #> | |...................... | 34% #> label: unnamed-chunk-6 #> | |........................ | 37% #> ordinary text without R code #> #> | |.......................... | 40% #> label: unnamed-chunk-7 (with options) #> List of 1 #> $ eval: logi FALSE #> #> | |............................ | 43% #> ordinary text without R code #> #> | |.............................. | 46% #> label: unnamed-chunk-8 #> | |................................ | 49% #> ordinary text without R code #> #> | |................................. | 51% #> label: unnamed-chunk-9 #> | |................................... | 54% #> ordinary text without R code #> #> | |..................................... | 57% #> label: unnamed-chunk-10 (with options) #> List of 3 #> $ echo : logi FALSE #> $ collapse: logi TRUE #> $ comment : logi NA #> #> | |....................................... | 60% #> ordinary text without R code #> #> | |......................................... | 63% #> label: unnamed-chunk-11 (with options) #> List of 3 #> $ echo : logi FALSE #> $ collapse: logi TRUE #> $ comment : logi NA #> #> | |........................................... | 66% #> ordinary text without R code #> #> | |............................................. | 69% #> label: unnamed-chunk-12 (with options) #> List of 1 #> $ eval: logi FALSE #> #> | |.............................................. | 71% #> inline R code fragments #> #> | |................................................ | 74% #> label: unnamed-chunk-13 (with options) #> List of 3 #> $ echo : logi FALSE #> $ collapse: logi TRUE #> $ comment : logi NA #> #> | |.................................................. | 77% #> inline R code fragments #> #> | |.................................................... | 80% #> label: unnamed-chunk-14 (with options) #> List of 3 #> $ echo : logi FALSE #> $ fig.height: num 5 #> $ fig.width : num 9 #>
#> | |...................................................... | 83% #> ordinary text without R code #> #> | |........................................................ | 86% #> label: unnamed-chunk-15 (with options) #> List of 3 #> $ echo : logi FALSE #> $ fig.height: num 5 #> $ fig.width : num 9 #>
#> | |.......................................................... | 89% #> ordinary text without R code #> #> | |........................................................... | 91% #> label: unnamed-chunk-16 (with options) #> List of 3 #> $ echo : logi FALSE #> $ fig.height: num 5 #> $ fig.width : num 9 #>
#> | |............................................................. | 94% #> ordinary text without R code #> #> | |............................................................... | 97% #> label: unnamed-chunk-17 (with options) #> List of 1 #> $ echo: logi FALSE #> #> | |.................................................................| 100% #> ordinary text without R code #> #>
#> output file: challenge.knit.md
#> /usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS challenge.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output /tmp/Rtmp7NoKFA/index.html --smart --email-obfuscation none --standalone --section-divs --template /home/adrien-alea/R/x86_64-pc-linux-gnu-library/3.3/rmarkdown/rmd/h/default.html --highlight-style tango --variable 'theme:spacelab' --include-in-header /tmp/Rtmp7NoKFA/rmarkdown-str48541a56ffd5.html --mathjax --variable 'mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
#> #> Output created: index.html
#> Next step: give the URL to "/tmp/Rtmp7NoKFA/index.html" to the participants.
unlink(outdir) setwd(wd) unlink(path)