Skip to content

Commit

Permalink
adjust pipedat report and figures
Browse files Browse the repository at this point in the history
  • Loading branch information
david-beauchesne committed May 23, 2023
1 parent c046e70 commit e184278
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
26 changes: 13 additions & 13 deletions R/pipeplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ plotingrid <- function(res, width, height, pal) {

# All folders in a loop
for(i in 1:length(files)) {
# Load data
dat <- dir(files[i], full.names = TRUE) |>
lapply(stars::read_stars)

# Load metadata
meta <- dir(here::here(files[i], ".."), full.names = TRUE, pattern = "yaml") |>
yaml::read_yaml()

for(j in 1:length(dat)) {
# Name of data for export
nm <- names(dat[[j]]) |>
tools::file_path_sans_ext()

sub <- stringr::str_split(nm, "-")[[1]]
sub <- sub[length(sub)]

# Filenames
filenames <- meta$ingrid$files

for(j in 1:length(dat)) {
# Name
nm <- filenames$filenames[j]
sub <- filenames$names[j]

# Load data
dat <- here::here(files[i], glue::glue("{nm}.tif")) |>
stars::read_stars()

# Output arguments
grDevices::png(
Expand All @@ -111,7 +111,7 @@ plotingrid <- function(res, width, height, pal) {
par(mar = c(1,0,5,0))

# Plot grid with base stars functionalities
image(dat[[j]], col = pal(100), main = meta$description$name)
image(dat, col = pal(100), main = meta$description$name)

# Subtext
mtext(side = 3, text = sub)
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
Binary file modified inst/extdata/pipeline_code.rda
Binary file not shown.
2 changes: 2 additions & 0 deletions inst/rmarkdown/templates/report/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ if (length(files) > 0) {
# Text
cat(" \n##", nm, "\n")
cat(meta$ingrid$description)
cat(" \n")
cat(glue::glue("![]({uid})"))
cat(" \n")
}
Expand Down

0 comments on commit e184278

Please sign in to comment.