Skip to contents

Get the current origin for each reuse

Usage

get_current_origin(
  as = "time",
  suppressPrinting = FALSE,
  format = "%Y-%m-%d %H:%M:%S %Z"
)

Arguments

as

Whether to return the origin as character value (can also be specified by passing string or text), as a numeric value (can also be specified by passing number), or as POSIX time (can also be specified by passing time).

suppressPrinting

Whether to suppress printing the message about how to store the origin in your R script.

format

If returning character, the format to pass to base::format() when formatting the time to a character value

Value

The origin, in the format specified in as.

Examples

squids::get_current_origin();
#> 🦑 To human-readably store an origin so that
#> 🦑 you can reproduce the same sequence of SQUIDs,
#> 🦑 you can use the following line in your R script:
#> 
#> SQUID_origin <- "2025-06-04 22:18:53 CEST";
#> 
#> 🦑 You can then pass `origin = SQUID_origin` when
#> 🦑 calling `squids::squids()`.
#> 
#> [1] "2025-06-04 22:18:53 CEST"

squids::get_current_origin(
  as = "number"
);
#> 🦑 To human-readably store an origin so that
#> 🦑 you can reproduce the same sequence of SQUIDs,
#> 🦑 you can use the following line in your R script:
#> 
#> SQUID_origin <- "2025-06-04 22:18:53 CEST";
#> 
#> 🦑 You can then pass `origin = SQUID_origin` when
#> 🦑 calling `squids::squids()`.
#> 
#> [1] 1749068334

squids::get_current_origin(
  as = "time"
);
#> 🦑 To human-readably store an origin so that
#> 🦑 you can reproduce the same sequence of SQUIDs,
#> 🦑 you can use the following line in your R script:
#> 
#> SQUID_origin <- "2025-06-04 22:18:53 CEST";
#> 
#> 🦑 You can then pass `origin = SQUID_origin` when
#> 🦑 calling `squids::squids()`.
#> 
#> [1] "2025-06-04 22:18:53 CEST"