Generate a photo-gallery README for a directory of figs
## this snippet was the original gist but the Rmd solution below is even nicer | |
## auto-generate a visual index as README.md in current working directory | |
fig_files <- list.files(pattern = "jpg$") # change to png$ as needed! | |
writeLines(paste0(fig_files, "\n", | |
"\n\n"), "README.md") |
--- | |
output: | |
html_document: | |
keep_md: TRUE | |
--- | |
I added this file after seeing Hadley's suggestion to do this in an R markdown chunk. | |
```{r, results ="asis", echo = FALSE} | |
fig_files <- dir(pattern = "png$") | |
cat(paste0("* ", fig_files, " \n")) | |
``` |
This comment has been minimized.
This comment has been minimized.
Good idea @hadley! I hate how I don't get notified of comments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
hadley commentedFeb 23, 2015
I think this might be better as an Rmarkdown block: