
R version 4.1.1 (2021-08-10) -- "Kick Things"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

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 values x/y
x       1 349  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE   NULL [x]
y       1 352 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE   NULL [y]
band    1   6      NA    NA                         NA    NA   NULL    
foo     1   4       1     1                         NA    NA   NULL    
> (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 values x/y
x       1 349  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE   NULL [x]
y       1 352 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE   NULL [y]
band    1   6      NA    NA                         NA    NA   NULL    
foo     1   4       1     1                         NA    NA   NULL    
> st_as_stars(rr)
stars object with 4 dimensions and 2 attributes
attribute(s), summary of first 1e+05 cells:
                                   Min. 1st Qu. Median    Mean 3rd Qu. Max.
a.L7_ETMs.tif.a.L7_ETMs.tif.b....    47      65     76 77.3419      87  255
a.L7_ETMs.tif.a.L7_ETMs.tif.b....    47      65     76 77.3419      87  255
dimension(s):
     from  to  offset delta                     refsys point values x/y
x       1 349  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE   NULL [x]
y       1 352 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE   NULL [y]
band    1   6      NA    NA                         NA    NA   NULL    
foo     1   4       1     1                         NA    NA   NULL    
> #(rrr = st_redimension(rr, along = list(bar = as.Date(c("2001-01-01", "2002-01-01")))))
> 
> proc.time()
   user  system elapsed 
  1.424   0.107   1.523 
