---
output: html_document
editor_options:
chunk_output_type: console
---
```{r, echo=FALSE, message=FALSE, warning=FALSE}
# put here the whole path to your picture folder
picture_folder <- "./picture/"
# put here the whole path to your sound folder
sound_folder <- "./sound/"
if(!require(tidyverse)){
install.packages("tidyverse")
library(tidyverse)
}
if(!require(DT)){
install.packages("DT")
}
if(!require(fs)){
install.packages("fs")
}
files <- fs::dir_ls(picture_folder)
files <- str_replace_all(files, picture_folder, "")
files <- str_replace_all(files, ".png$", "")
tibble(files) %>%
rowwise() %>%
mutate(sound_files = nth(unlist(str_split(files, "_")), -4),
tier = nth(unlist(str_split(files, "_")), -3),
label = paste0(nth(unlist(str_split(files, "_")), -2), nth(unlist(str_split(files, "_")), -1)),
audio = paste0(''),
pictures = paste0('
')) %>%
select(-files) %>%
DT::datatable(filter = 'top', rownames = FALSE, options = list(pageLength = 50, dom = 'tip'), escape = FALSE)
```