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://help.dropbox.com/fr-fr/files-folders/share/public-folder. Alternatively, GitHub Pages provide an easy HTML web publishing solution via a simple GitHub repository.

See also

Examples

path <- tempdir() wd <- setwd(path) new_challenge()
#> New challenge installed in: "/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpcOhZNa" #> 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("/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpcOhZNa/challenge.rmd")'
outdir = tempdir() if (rmarkdown::pandoc_available('1.12.3')) { 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/local/bin/pandoc +RTS -K512m -RTS challenge.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpcOhZNa/index.html --lua-filter /Users/runner/work/_temp/Library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Users/runner/work/_temp/Library/rmarkdown/rmarkdown/lua/latex-div.lua --variable bs3=TRUE --standalone --section-divs --template /Users/runner/work/_temp/Library/rmarkdown/rmd/h/default.html --highlight-style tango --variable theme=spacelab --include-in-header /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpcOhZNa/rmarkdown-str13dd7a820c2b.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
#> #> Output created: index.html
#> Next step: give the URL to "/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpcOhZNa/index.html" to the participants.
unlink(outdir) setwd(wd) unlink(path)