Create an RMarkdown document from a series of photos
photo_rmd(f, title = "Day 1", captions = NULL)
f | File path to photo(s). |
---|---|
title | The title of the document or chapter |
captions | A character vector of captions |
f = geotagged_photo_paths() photo = photos_sf(f) rmd_text = photo_rmd(photo$SourceFile) writeLines(rmd_text, file.path(tempdir(), "photo.Rmd")) if(require(rmarkdown)) { rmarkdown::render(file.path(tempdir(), "photo.Rmd")) }#>#> #> #>#> | | | 0% | |...... | 9% #> ordinary text without R code #> #> | |............ | 18% #> label: unnamed-chunk-1 (with options) #> List of 1 #> $ fig.cap: chr "/home/travis/build/Robinlovelace/photomapr/inst/photos/IMG_20190523_120605_logo.jpg" #> #> | |.................. | 27% #> ordinary text without R code #> #> | |........................ | 36% #> label: unnamed-chunk-2 (with options) #> List of 1 #> $ fig.cap: chr "/home/travis/build/Robinlovelace/photomapr/inst/photos/IMG_20190523_135034_logo.jpg" #> #> | |.............................. | 45% #> ordinary text without R code #> #> | |................................... | 55% #> label: unnamed-chunk-3 (with options) #> List of 1 #> $ fig.cap: chr "/home/travis/build/Robinlovelace/photomapr/inst/photos/IMG_20190524_104545_logo.jpg" #> #> | |......................................... | 64% #> ordinary text without R code #> #> | |............................................... | 73% #> label: unnamed-chunk-4 (with options) #> List of 1 #> $ fig.cap: chr "/home/travis/build/Robinlovelace/photomapr/inst/photos/IMG_20190524_110720_logo.jpg" #> #> | |..................................................... | 82% #> ordinary text without R code #> #> | |........................................................... | 91% #> label: unnamed-chunk-5 (with options) #> List of 1 #> $ fig.cap: chr "/home/travis/build/Robinlovelace/photomapr/inst/photos/IMG_20190524_200945_logo.jpg" #> #> | |.................................................................| 100% #> ordinary text without R code #> #>#>#> /usr/bin/pandoc +RTS -K512m -RTS photo.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output photo.html --email-obfuscation none --self-contained --standalone --section-divs --template /home/travis/R/Library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable 'theme:bootstrap' --include-in-header /tmp/RtmpKcGaw2/rmarkdown-str6dc9197266e.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --metadata pagetitle=photo.utf8.md#> #># file.edit(file.path(tempdir(), "photo.Rmd")) # browseURL(file.path(tempdir(), "photo.html"))