Skip to content

Commit

Permalink
Use here_input()
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardlavender committed Oct 22, 2024
1 parent fb8d58d commit e058c1a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
12 changes: 6 additions & 6 deletions analyses/patter_01_setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ stopifnot(all(!is.na(detections$receiver_id)))
metadata <- as.data.table(metadata)

#### Save datasets
terra::writeRaster(map, "./data/patter/input/map.tif")
qs::qsave(map_len, "./data/patter/input/map_len.qs")
qs::qsave(start, "./data/patter/input/start.qs")
qs::qsave(moorings, "./data/patter/input/moorings.qs")
qs::qsave(detections, "./data/patter/input/detections.qs")
qs::qsave(metadata, "./data/patter/input/metadata.qs")
terra::writeRaster(map, here_input("map.tif"))
qs::qsave(map_len, here_input("map_len.qs"))
qs::qsave(start, here_input("start.qs"))
qs::qsave(moorings, here_input("moorings.qs"))
qs::qsave(detections, here_input("detections.qs"))
qs::qsave(metadata, here_input("metadata.qs"))


#### End of code.
Expand Down
11 changes: 11 additions & 0 deletions src/utils.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
here_input <- function() {
here::here("data", "patter", "input")
}

here_output <- function() {
here::here("data", "patter", "output")
}

os_linux <- function() {
grepl("linux", tolower(Sys.info()["sysname"]))
}

0 comments on commit e058c1a

Please sign in to comment.