R Under development (unstable) (2023-08-09 r84924 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > suppressPackageStartupMessages(library(stars)) > tif = system.file("tif/L7_ETMs.tif", package = "stars") > r = read_stars(list(a = c(tif,tif), b = c(tif, tif)), proxy = TRUE) > (xx = st_redimension(r, along = list(foo = 1:4))) stars_proxy object with 1 attribute in 4 file(s): $a.L7_ETMs.tif.a.L7_ETMs.tif.b.L7_ETMs.tif.b.L7_ETMs.tif [1] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" [4] "[...]/L7_ETMs.tif" dimension(s): from to offset delta refsys point x/y x 1 349 288776 28.5 SIRGAS 2000 / UTM zone 25S FALSE [x] y 1 352 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE [y] band 1 6 NA NA NA NA foo 1 4 1 1 NA NA > (rr = c(xx, xx)) stars_proxy object with 2 attributes in 8 file(s): $a.L7_ETMs.tif.a.L7_ETMs.tif.b.L7_ETMs.tif.b.L7_ETMs.tif [1] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" [4] "[...]/L7_ETMs.tif" $a.L7_ETMs.tif.a.L7_ETMs.tif.b.L7_ETMs.tif.b.L7_ETMs.tif [1] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" [4] "[...]/L7_ETMs.tif" dimension(s): from to offset delta refsys point x/y x 1 349 288776 28.5 SIRGAS 2000 / UTM zone 25S FALSE [x] y 1 352 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE [y] band 1 6 NA NA NA NA foo 1 4 1 1 NA NA > # st_as_stars(rr) > (rrr = st_redimension(rr, along = list(bar = as.Date(c("2001-01-01", "2002-01-01"))))) stars_proxy object with 1 attribute in 8 file(s): $a.L7_ETMs.tif.a.L7_ETMs.tif.b.L7_ETMs.tif.b.L7_ETMs.tif.a.L7_ETMs.tif.a.L7_ETMs.tif.b.L7_ETMs.tif.b.L7_ETMs.tif [1] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" [4] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" [7] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" dimension(s): from to offset delta refsys point x/y x 1 349 288776 28.5 SIRGAS 2000 / UTM zone 25S FALSE [x] y 1 352 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE [y] band 1 6 NA NA NA NA foo 1 4 1 1 NA NA bar 1 2 2001-01-01 365 days Date NA > (rr = c(a = xx, b = xx)) stars_proxy object with 2 attributes in 8 file(s): $a [1] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" [4] "[...]/L7_ETMs.tif" $b [1] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" [4] "[...]/L7_ETMs.tif" dimension(s): from to offset delta refsys point x/y x 1 349 288776 28.5 SIRGAS 2000 / UTM zone 25S FALSE [x] y 1 352 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE [y] band 1 6 NA NA NA NA foo 1 4 1 1 NA NA > # st_as_stars(rr) > (rrr = st_redimension(rr, along = list(bar = as.Date(c("2001-01-01", "2002-01-01"))))) stars_proxy object with 1 attribute in 8 file(s): $a.b [1] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" [4] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" [7] "[...]/L7_ETMs.tif" "[...]/L7_ETMs.tif" dimension(s): from to offset delta refsys point x/y x 1 349 288776 28.5 SIRGAS 2000 / UTM zone 25S FALSE [x] y 1 352 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE [y] band 1 6 NA NA NA NA foo 1 4 1 1 NA NA bar 1 2 2001-01-01 365 days Date NA > > proc.time() user system elapsed 1.10 0.14 1.25