Find commonly used images from runza/
get_emw_image.RdReturns the URL for the image based on folder_path and name
Examples
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
## Need to set folder path correctly each time
fitz_data <- tibble(
id = 1:4,
scene = c("baby", "park", "play", "silly"),
x_pos = c(1, 2, 1, 2),
y_pos = c(1, 1, 2, 2)
)
#'
# Add image paths to the dataset
fitz_data_with_images <- fitz_data |>
mutate(
image_path = get_emw_image("fitz/", scene)
)
# Display the resulting data frame
print(fitz_data_with_images)
#> # A tibble: 4 × 5
#> id scene x_pos y_pos image_path
#> <int> <chr> <dbl> <dbl> <glue>
#> 1 1 baby 1 1 https://emmarshall.github.io/runza/img/fitz/baby.png
#> 2 2 park 2 1 https://emmarshall.github.io/runza/img/fitz/park.png
#> 3 3 play 1 2 https://emmarshall.github.io/runza/img/fitz/play.png
#> 4 4 silly 2 2 https://emmarshall.github.io/runza/img/fitz/silly.png