Running 'aggregate.R' [169s]
  Running 'align.R' [155s]
  Running 'area.R' [166s]
  Running 'crop.R' [6s]
  Comparing 'crop.Rout' to 'crop.Rout.save' ... OK
  Running 'curvilinear.R' [1s]
  Comparing 'curvilinear.Rout' to 'curvilinear.Rout.save' ... OK
  Running 'datasets.R' [158s]
  Running 'dimensions.R' [3s]
  Comparing 'dimensions.Rout' to 'dimensions.Rout.save' ... OK
  Running 'downsample.R' [174s]
  Running 'ee.R' [2s]
  Comparing 'ee.Rout' to 'ee.Rout.save' ... OK
  Running 'extract.R' [165s]
  Running 'gridtypes.R' [169s]
  Running 'mdim.R' [170s]
  Running 'nc.R' [2s]
  Comparing 'nc.Rout' to 'nc.Rout.save' ... OK
  Running 'plot.R' [3s]
  Comparing 'plot.Rout' to 'plot.Rout.save' ... OK
  Running 'predict.R' [160s]
  Running 'proxy.R' [4s]
  Comparing 'proxy.Rout' to 'proxy.Rout.save' ... OK
  Running 'raster.R' [8s]
  Comparing 'raster.Rout' to 'raster.Rout.save' ...103,104c103,104
< x          1 10   -180    36 WGS 84 (CRS84)         NULL [x]
< y          1 10     90   -18 WGS 84 (CRS84)         NULL [y]
---
> x          1 10   -180    36 WGS 84         NULL [x]
> y          1 10     90   -18 WGS 84         NULL [y]
  Running 'rasterize.R' [3s]
  Comparing 'rasterize.Rout' to 'rasterize.Rout.save' ... OK
  Running 'rectilinear.R' [2s]
  Comparing 'rectilinear.Rout' to 'rectilinear.Rout.save' ... OK
  Running 'redimension.R' [179s]
  Running 'sf.R' [2s]
  Comparing 'sf.Rout' to 'sf.Rout.save' ... OK
  Running 'sp.R' [173s]
  Running 'spacetime.R' [149s]
  Running 'spatstat.R' [174s]
  Running 'stars.R' [9s]
  Comparing 'stars.Rout' to 'stars.Rout.save' ...257,258c257,258
< x    1 360   -180     1 WGS 84 (CRS84) [x]
< y    1 180     90    -1 WGS 84 (CRS84) [y]
---
> x    1 360   -180     1 WGS 84 [x]
> y    1 180     90    -1 WGS 84 [y]
  Running 'subset.R' [157s]
  Running 'testthat.R' [12s]
  Comparing 'testthat.Rout' to 'testthat.Rout.save' ... OK
  Running 'tidy.R' [170s]
  Running 'transform.R' [156s]
  Running 'warp.R' [3s]
  Comparing 'warp.Rout' to 'warp.Rout.save' ... OK
  Running 'write.R' [2s]
  Comparing 'write.Rout' to 'write.Rout.save' ... OK
Running the tests in 'tests/aggregate.R' failed.
Complete output:
  > library(stars)
  Loading required package: abind
  Loading required package: sf
  Linking to GEOS 3.11.2, GDAL 3.8.2, PROJ 9.3.1; sf_use_s2() is TRUE
  > 
  > if (suppressPackageStartupMessages(require(sp, quietly = TRUE)) && require(spacetime, quietly = TRUE)) {
  + data(air) # this loads several datasets in .GlobalEnv
  + dim(air)
  + d = st_dimensions(station = st_set_crs(st_as_sfc(stations), 4326), time = dates)
  + 
  + blocks = st_make_grid(st_as_sfc("POLYGON ((5.871619 47.26986, 15.03811 47.26986, 15.03811 55.05653, 5.871619 55.05653, 5.871619 47.26986))", crs = 4326),
  + 	n = c(3,3))
  + 
  + print(aq <- st_as_stars(list(PM10 = air), dimensions = d))
  + print(a <- aggregate(aq, blocks, mean, na.rm = TRUE))
  + }
  stars object with 2 dimensions and 1 attribute
  attribute(s):
        Min. 1st Qu. Median     Mean 3rd Qu.    Max.   NA's
  PM10     0   9.921 14.792 17.69728  21.992 274.333 157659
  dimension(s):
          from   to     offset  delta refsys point
  station    1   70         NA     NA WGS 84  TRUE
  time       1 4383 1998-01-01 1 days   Date FALSE
                                                           values
  station POINT (9.585911 53.67057),...,POINT (9.446661 49.24068)
  time                                                       NULL
  stars object with 2 dimensions and 1 attribute
  attribute(s):
        Min. 1st Qu.   Median    Mean  3rd Qu.    Max. NA's
  PM10     1      11 15.57425 18.1715 22.17197 183.271 8429
  dimension(s):
           from   to     offset  delta refsys point
  geometry    1    9         NA     NA WGS 84 FALSE
  time        1 4383 1998-01-01 1 days   Date FALSE
                                                                  values
  geometry POLYGON ((5.871619 47.269...,...,POLYGON ((11.98261 52.460...
  time                                                              NULL
  > 
  > # adapted from ?read_stars:
  > m = array(1:720, dim = c(x = 10, y = 12, t = 6)) # named dim
  > st = st_as_stars(m)
  > attr(st, "dimensions")$y$delta = -1
  > attr(st, "dimensions")$y$offset = 12
  > tm = as.Date("2019-02-19") + 1:6
  > st = st_set_crs(st_set_dimensions(st, 3, values = tm), 4326)
  > 
  > tmp = tempfile(fileext = ".tif")
  > write_stars(st, tmp)
  > 
  > (red <- setNames(read_stars(tmp, RasterIO = list(nXOff = 1, nYOff = 1, nXsize = 10, nYSize = 12,
  +    nBufXSize = 2, nBufYSize = 2)), "foo"))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
       Min. 1st Qu. Median  Mean 3rd Qu. Max.
  foo    33  199.25  365.5 365.5  531.75  698
  dimension(s):
       from to offset delta refsys point x/y
  x       1  2      0     5 WGS 84 FALSE [x]
  y       1  2     12    -6 WGS 84 FALSE [y]
  band    1  6     NA    NA     NA    NA    
  > 
  > sfc = st_set_crs(st_as_sfc(red, as_points = FALSE), st_crs(st))
  > (a = aggregate(st, st_sf(a = 1, geom = sfc), mean))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median  Mean 3rd Qu. Max.
  A1    28  194.25  360.5 360.5  526.75  693
  dimension(s):
       from to     offset  delta refsys point
  geom    1  4         NA     NA WGS 84 FALSE
  t       1  6 2019-02-20 1 days   Date FALSE
                                                              values
  geom POLYGON ((0 12, 5 12, 5 6...,...,POLYGON ((5 6, 10 6, 10 0...
  t                                                             NULL
  > (a = aggregate(st, sfc, mean))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median  Mean 3rd Qu. Max.
  A1    28  194.25  360.5 360.5  526.75  693
  dimension(s):
           from to     offset  delta refsys point
  geometry    1  4         NA     NA WGS 84 FALSE
  t           1  6 2019-02-20 1 days   Date FALSE
                                                                  values
  geometry POLYGON ((0 12, 5 12, 5 6...,...,POLYGON ((5 6, 10 6, 10 0...
  t                                                                 NULL
  > if (require(raster)) {
  +  print(a <- aggregate(st, sfc, mean, exact = TRUE))
  +  print(a[[1]])
  +  print(sum(a[[1]])*30 == sum(1:720))
  + }
  Loading required package: raster
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median  Mean 3rd Qu. Max.
  A1    28  194.25  360.5 360.5  526.75  693
  dimension(s):
           from to     offset  delta refsys point
  geometry    1  4         NA     NA WGS 84 FALSE
  t           1  6 2019-02-20 1 days   Date FALSE
                                                                  values
  geometry POLYGON ((0 12, 5 12, 5 6...,...,POLYGON ((5 6, 10 6, 10 0...
  t                                                                 NULL
       [,1] [,2] [,3] [,4] [,5] [,6]
  [1,]   28  148  268  388  508  628
  [2,]   33  153  273  393  513  633
  [3,]   88  208  328  448  568  688
  [4,]   93  213  333  453  573  693
  [1] TRUE
  > 
  > tm0 = as.Date("2019-02-19") + -1:8
  > (a = aggregate(st, tm0, mean, na.rm = TRUE))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median  Mean 3rd Qu. Max. NA's
  A1     1  180.75  360.5 360.5  540.25  720  480
  dimension(s):
       from to     offset  delta refsys point x/y
  time    1 10 2019-02-18 1 days   Date    NA    
  x       1 10          0      1 WGS 84 FALSE [x]
  y       1 12         12     -1 WGS 84 FALSE [y]
  > (a = aggregate(st, "days", mean, na.rm = TRUE))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median  Mean 3rd Qu. Max.
  A1     1  180.75  360.5 360.5  540.25  720
  dimension(s):
       from to     offset  delta refsys point x/y
  time    1  6 2019-02-20 1 days   Date    NA    
  x       1 10          0      1 WGS 84 FALSE [x]
  y       1 12         12     -1 WGS 84 FALSE [y]
  > yd = function(x) as.POSIXlt(x)$yday
  > (a = aggregate(st, yd, mean, na.rm = TRUE))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median  Mean 3rd Qu. Max.
  A1     1  180.75  360.5 360.5  540.25  720
  dimension(s):
           from to offset delta refsys point    values x/y
  geometry    1  6     NA    NA     NA    NA 50,...,55    
  x           1 10      0     1 WGS 84 FALSE      NULL [x]
  y           1 12     12    -1 WGS 84 FALSE      NULL [y]
  > 
  > # with "by" geometry not overlapping x
  > pt = st_point(c(-10,-10))
  > (sfc = c(sfc, st_sfc(pt, crs = st_crs(sfc))))
  Geometry set for 5 features 
  Geometry type: GEOMETRY
  Dimension:     XY
  Bounding box:  xmin: -10 ymin: -10 xmax: 10 ymax: 12
  Geodetic CRS:  WGS 84
  POLYGON ((0 12, 5 12, 5 6, 0 6, 0 12))
  POLYGON ((5 12, 10 12, 10 6, 5 6, 5 12))
  POLYGON ((0 6, 5 6, 5 0, 0 0, 0 6))
  POLYGON ((5 6, 10 6, 10 0, 5 0, 5 6))
  POINT (-10 -10)
  > (a = aggregate(st, sfc, mean))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median  Mean 3rd Qu. Max. NA's
  A1    28  194.25  360.5 360.5  526.75  693    6
  dimension(s):
           from to     offset  delta refsys point
  geometry    1  5         NA     NA WGS 84 FALSE
  t           1  6 2019-02-20 1 days   Date FALSE
                                                     values
  geometry POLYGON ((0 12, 5 12, 5 6...,...,POINT (-10 -10)
  t                                                    NULL
  > (a = aggregate(st, st, mean))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median  Mean 3rd Qu. Max.
  A1     1  180.75  360.5 360.5  540.25  720
  dimension(s):
           from  to     offset  delta refsys point
  geometry    1 120         NA     NA WGS 84 FALSE
  t           1   6 2019-02-20 1 days   Date FALSE
                                                                  values
  geometry POLYGON ((0 12, 1 12, 1 1...,...,POLYGON ((9 1, 10 1, 10 0...
  t                                                                 NULL
  > 
  > proc.time()
     user  system elapsed 
     8.45    0.54    8.95 
Running the tests in 'tests/align.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(stars))
  > set.seed(1331)
  > st_sample(st_as_sfc(st_bbox(L7_ETMs)), 1)
  Geometry set for 1 feature 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 291430.8 ymin: 9111430 xmax: 291430.8 ymax: 9111430
  Projected CRS: SIRGAS 2000 / UTM zone 25S
  POINT (291430.8 9111430)
  > b = st_buffer(st_sample(st_as_sfc(st_bbox(L7_ETMs)), 1), 335)
  > bba = stars:::st_align(st_bbox(b), st_dimensions(L7_ETMs))
  > 
  > plot(L7_ETMs[,,,1], extent = st_buffer(b, 20), reset = FALSE, key.pos = NULL)
  > plot(b, add = TRUE, col = NA, border = 'red')
  > plot(st_as_sfc(st_bbox(b)), col = NA, border = 'red', add = TRUE)
  > plot(st_as_sfc(bba), col = NA, border = 'blue', add = TRUE)
  > st_bbox(b)
       xmin      ymin      xmax      ymax 
   297116.8 9119404.1  297786.8 9120074.1 
  > bba
       xmin      ymin      xmax      ymax 
   297098.3 9119392.8  297810.8 9120076.8 
  > 
  > plot(L7_ETMs[,,,1], reset = FALSE, key.pos = NULL)
  > plot(b, col = 'red', add = TRUE)
  > plot(st_as_sfc(bba), col = NA, border = 'blue', add = TRUE)
  > 
  > b0 = st_buffer(b, -100)
  > L7 = st_as_stars(L7_ETMs)[b0][,,,1] |> st_normalize()
  > bbb = stars:::st_align(st_bbox(b), st_dimensions(L7))
  > plot(L7, extent = st_buffer(b, 120), reset = FALSE, key.pos = NULL)
  > plot(st_as_sfc(st_bbox(L7)), col = NA, border = 'black', add = TRUE)
  > plot(st_as_sfc(bbb), col = NA, border = 'blue', add = TRUE)
  > plot(b, col = NA, border = 'red', add = TRUE)
  > 
  > all.equal(bbb, bba)
  [1] TRUE
  > 
  > proc.time()
     user  system elapsed 
     2.00    0.39    2.37 
Running the tests in 'tests/area.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(stars))
  > tif = system.file("tif/L7_ETMs.tif", package = "stars")
  > x = read_stars(tif)
  > (a = st_area(x[,1:5,1:5]))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median   Mean 3rd Qu.   Max.
  area [m^2] 812.25  812.25 812.25 812.25  812.25 812.25
  dimension(s):
    from to  offset delta                     refsys point x/y
  x    1  5  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE [x]
  y    1  5 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE [y]
  > 
  > m = matrix(1:20, nrow = 5, ncol = 4)
  > x = c(0, 0.5, 1, 2, 4, 5)  # 6 numbers: boundaries!
  > y = c(0.3, 0.5, 1, 2, 2.2) # 5 numbers: boundaries!
  > (r = st_as_stars(list(m = m), dimensions = st_dimensions(x = x, y = y)))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  m     1    5.75   10.5 10.5   15.25   20
  dimension(s):
    from to point                values x/y
  x    1  5 FALSE     [0,0.5),...,[4,5) [x]
  y    1  4 FALSE [0.3,0.5),...,[2,2.2) [y]
  > # image(r, axes = TRUE, col = grey((1:20)/20))
  > (a = st_area(r))
  Missing coordinate reference system: assuming Cartesian coordinates
  stars object with 2 dimensions and 1 attribute
  attribute(s):
        Min. 1st Qu. Median  Mean 3rd Qu. Max.
  area   0.1     0.2  0.325 0.475     0.5    2
  dimension(s):
    from to point                values x/y
  x    1  5 FALSE     [0,0.5),...,[4,5) [x]
  y    1  4 FALSE [0.3,0.5),...,[2,2.2) [y]
  > #plot(a, axes = TRUE)
  > 
  > s5p = system.file("sentinel5p/S5P_NRTI_L2__NO2____20180717T120113_20180717T120613_03932_01_010002_20180717T125231.nc", package = "starsdata")
  > if (s5p != "") {
  +  nit.c = read_stars(s5p, sub = "//PRODUCT/SUPPORT_DATA/DETAILED_RESULTS/nitrogendioxide_summed_total_column",
  + 	curvilinear = c("//PRODUCT/longitude", "//PRODUCT/latitude"), driver = NULL)
  +  if (inherits(nit.c[[1]], "units"))
  + 	nit.c[[1]] = units::drop_units(nit.c[[1]])
  +  nit.c[[1]][nit.c[[1]] > 9e+36] = NA
  +  st_crs(nit.c) = 4326
  +  print((a <- st_area(nit.c[,1:5,1:5])))
  +  # plot(a, axes = TRUE, border = NA)
  + }
  > 
  > proc.time()
     user  system elapsed 
     1.09    0.34    1.42 
Running the tests in 'tests/datasets.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(stars))
  > bcsd_obs
  stars_proxy object with 2 attributes in 2 file(s):
  $foo
  [1] "[...]/bcsd_obs_1999.nc:pr"
  
  $bar
  [1] "[...]/bcsd_obs_1999.nc:tas"
  
  dimension(s):
       from to offset  delta  refsys                    values x/y
  x       1 81    -85  0.125      NA                      NULL [x]
  y       1 33  37.12 -0.125      NA                      NULL [y]
  time    1 12     NA     NA POSIXct 1999-01-31,...,1999-12-31    
  > L7_ETMs
  stars_proxy object with 1 attribute in 1 file(s):
  $L7_ETMs
  [1] "[...]/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    
  > if (require(starsdata, quietly = TRUE)) {
  + 	print(stars_sentinel2)
  + }
  > 
  > proc.time()
     user  system elapsed 
     1.39    0.31    1.70 
Running the tests in 'tests/downsample.R' failed.
Complete output:
  > library(stars)
  Loading required package: abind
  Loading required package: sf
  Linking to GEOS 3.11.2, GDAL 3.8.2, PROJ 9.3.1; sf_use_s2() is TRUE
  > m = matrix(1:121, 11, 11)
  > m
        [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
   [1,]    1   12   23   34   45   56   67   78   89   100   111
   [2,]    2   13   24   35   46   57   68   79   90   101   112
   [3,]    3   14   25   36   47   58   69   80   91   102   113
   [4,]    4   15   26   37   48   59   70   81   92   103   114
   [5,]    5   16   27   38   49   60   71   82   93   104   115
   [6,]    6   17   28   39   50   61   72   83   94   105   116
   [7,]    7   18   29   40   51   62   73   84   95   106   117
   [8,]    8   19   30   41   52   63   74   85   96   107   118
   [9,]    9   20   31   42   53   64   75   86   97   108   119
  [10,]   10   21   32   43   54   65   76   87   98   109   120
  [11,]   11   22   33   44   55   66   77   88   99   110   121
  > s = st_as_stars(m)
  > st_downsample(s, 1)
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1     1    28.5     61   61    93.5  121
  dimension(s):
     from to offset delta point x/y
  X1    1  6      0     2 FALSE [x]
  X2    1  6      0     2 FALSE [y]
  > st_downsample(s, 1)[[1]]
       [,1] [,2] [,3] [,4] [,5] [,6]
  [1,]    1   23   45   67   89  111
  [2,]    3   25   47   69   91  113
  [3,]    5   27   49   71   93  115
  [4,]    7   29   51   73   95  117
  [5,]    9   31   53   75   97  119
  [6,]   11   33   55   77   99  121
  > st_downsample(s, 1, offset = 1)
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1    13      37     61   61      85  109
  dimension(s):
     from to offset delta point x/y
  X1    1  5      1     2 FALSE [x]
  X2    1  5      1     2 FALSE [y]
  > st_downsample(s, 1, offset = 1)[[1]]
       [,1] [,2] [,3] [,4] [,5]
  [1,]   13   35   57   79  101
  [2,]   15   37   59   81  103
  [3,]   17   39   61   83  105
  [4,]   19   41   63   85  107
  [5,]   21   43   65   87  109
  > st_downsample(s, 1, FUN = mean)
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1     7      31     55   55      79  103
  dimension(s):
     from to offset delta point x/y
  X1    1  5      0     2 FALSE [x]
  X2    1  5      0     2 FALSE [y]
  > st_downsample(s, 1, FUN = mean)[[1]]
       [,1] [,2] [,3] [,4] [,5]
  [1,]    7   29   51   73   95
  [2,]    9   31   53   75   97
  [3,]   11   33   55   77   99
  [4,]   13   35   57   79  101
  [5,]   15   37   59   81  103
  > st_downsample(s, 1, offset = 1, FUN = mean)
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1    19      43     67   67      91  115
  dimension(s):
     from to offset delta point x/y
  X1    1  5      1     2 FALSE [x]
  X2    1  5      1     2 FALSE [y]
  > st_downsample(s, 1, offset = c(0,1), FUN = mean)[[1]]
       [,1] [,2] [,3] [,4] [,5]
  [1,]   18   40   62   84  106
  [2,]   20   42   64   86  108
  [3,]   22   44   66   88  110
  [4,]   24   46   68   90  112
  [5,]   26   48   70   92  114
  > st_downsample(s, 1, offset = c(0,1))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1    12    36.5     61   61    85.5  110
  dimension(s):
     from to offset delta point x/y
  X1    1  6      0     2 FALSE [x]
  X2    1  5      1     2 FALSE [y]
  > st_downsample(s, 1, offset = c(0,1))[[1]]
       [,1] [,2] [,3] [,4] [,5]
  [1,]   12   34   56   78  100
  [2,]   14   36   58   80  102
  [3,]   16   38   60   82  104
  [4,]   18   40   62   84  106
  [5,]   20   42   64   86  108
  [6,]   22   44   66   88  110
  > 
  > proc.time()
     user  system elapsed 
     1.03    0.31    1.32 
Running the tests in 'tests/extract.R' failed.
Complete output:
  > # Create 'stars' object
  > set.seed(1331)
  > suppressPackageStartupMessages(library(stars))
  > volcano = rbind(volcano, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA) # add NA rows
  > d = st_dimensions(x = 1:ncol(volcano), y = 1:nrow(volcano))
  > (r = st_as_stars(t(volcano)))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median     Mean 3rd Qu. Max. NA's
  A1    94     108    124 130.1879     150  195  732
  dimension(s):
     from to offset delta point x/y
  X1    1 61      0     1 FALSE [x]
  X2    1 99      0     1 FALSE [y]
  > r = st_set_dimensions(r, 1, offset = 0, delta = 1)
  > r = st_set_dimensions(r, 2, offset = nrow(volcano), delta = -1)
  > 
  > # Create points
  > pnt = st_sample(st_as_sfc(st_bbox(r)), 100)
  > pnt = st_as_sf(pnt)
  > 
  > # Extract - 'st_join'
  > x = st_join(pnt, st_as_sf(r))
  > 
  > # Extract - 'st_extract'
  > y = st_extract(r, pnt)
  > 
  > # check there are NA's:
  > any(is.na(x))
  [1] TRUE
  > # Compare
  > all.equal(x$A1, y[[1]])
  [1] TRUE
  > 
  > ################################################
  > if (FALSE) {
  + 
  + ## tic: segfaults
  + # check equal results with stars_proxy:
  + #x = st_extract(stars:::st_as_stars_proxy(r), pnt)
  + #all.equal(x$A1, y[[1]])
  + #all.equal(x, y)
  + 
  + r = c(r, 2*r, 10*r)
  + x = st_join(pnt, st_as_sf(r))
  + y = st_as_sf(st_extract(r, pnt))
  + all.equal(x, y)
  + 
  + ## tic: segfaults
  + #x = st_extract(stars:::st_as_stars_proxy(merge(r)), pnt)
  + #all.equal(st_as_sf(x), y)
  + 
  + tif = system.file("tif/L7_ETMs.tif", package = "stars")
  + xp = read_stars(tif, proxy = TRUE)
  + xm = read_stars(tif, proxy = FALSE)
  + pts = st_sample(st_as_sfc(st_bbox(xp)), 10)
  + pts = c(pts, st_as_sfc("POINT(0 0)"), pts)
  + em = st_extract(xm, pts)
  + if (utils::packageVersion("sf") >= "0.9-7") {
  + 	ep = st_extract(xp, pts)
  + 	print(all.equal(ep, em, check.attributes = TRUE))
  + }
  + 
  + # two-attribute objects:
  + library(stars)
  + tif = system.file("tif/L7_ETMs.tif", package = "stars")
  + xp = read_stars(c(tif, tif), proxy = TRUE)
  + xm = read_stars(c(tif, tif), proxy = FALSE)
  + pts = st_sample(st_as_sfc(st_bbox(xp)), 10)
  + pts = c(pts, st_as_sfc("POINT(0 0)"), pts)
  + em = st_extract(xm, pts)
  + if (utils::packageVersion("sf") >= "0.9-7") {
  + 	ep = st_extract(xp, pts)
  + 	print(all.equal(ep, em, check.attributes = TRUE))
  + }
  + 
  + # single-attribute, single raster objects:
  + tif1 = paste0(tempfile(), ".tif")
  + write_stars(xm[1,,,1], "x.tif")
  + xp = read_stars("x.tif", proxy = TRUE)
  + xm = read_stars("x.tif", proxy = FALSE)
  + em = st_extract(xm, pts)
  + if (utils::packageVersion("sf") >= "0.9-7") {
  + 	ep = st_extract(xp, pts)
  + 	print(all.equal(ep, em, check.attributes = TRUE))
  + }
  + 
  + # multiple-file attributes:
  + x = c(
  +   "avhrr-only-v2.19810901.nc",
  +   "avhrr-only-v2.19810902.nc",
  +   "avhrr-only-v2.19810903.nc",
  +   "avhrr-only-v2.19810904.nc",
  +   "avhrr-only-v2.19810905.nc",
  +   "avhrr-only-v2.19810906.nc",
  +   "avhrr-only-v2.19810907.nc",
  +   "avhrr-only-v2.19810908.nc",
  +   "avhrr-only-v2.19810909.nc"
  + )
  + file_list = system.file(paste0("netcdf/", x), package = "starsdata")
  + if (!identical(file_list, "")) {
  +   y = read_stars(file_list, quiet = TRUE)
  +   print(y)
  +   st_crs(y) = "OGC:CRS84"
  +   pts = st_sample(st_as_sfc(st_bbox(y)), 10)
  +   em = st_extract(y, pts)
  + 
  +   (y = read_stars(file_list, quiet = TRUE, proxy = TRUE))
  +   print(y)
  +   st_crs(y) = "OGC:CRS84"
  +   if (utils::packageVersion("sf") >= "0.9-7") {
  + 	  ep = st_extract(y, pts)
  + 	  print(all.equal(em, ep))
  +   }
  + }
  + 
  + # nearest & bilinear comparison:
  + if (utils::packageVersion("sf") >= "0.9-7") {
  +   set.seed(12331)
  +   s = st_as_stars(matrix(rnorm(16), 4))
  +   pts = st_sample(st_as_sfc(st_bbox(s)), 10000, type = "regular")
  +   s1 = st_extract(s, pts, bilinear = FALSE)
  +   s2 = st_extract(s, pts, bilinear = TRUE)
  +   s1$s2 = s2[[1]]
  +   names(s1)[c(1,3)] = c("nearest", "bilinear")
  +   print(s1[sample(10000, 5),])
  + }
  + }
  > 
  > proc.time()
     user  system elapsed 
     1.29    0.20    1.48 
Running the tests in 'tests/gridtypes.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(stars))
  > 
  > # regular, but not spatial:
  > d = st_dimensions(a = 1:3, b = 1:3, band = c("foo", "bar"))
  > (st = st_as_stars(array(1:18, c(3,3,2)), dimension = d))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  X     1    5.25    9.5  9.5   13.75   18
  dimension(s):
       from to offset delta point   values
  a       1  3      1     1 FALSE     NULL
  b       1  3      1     1 FALSE     NULL
  band    1  2     NA    NA FALSE foo, bar
  > as.data.frame(st, add_max=FALSE)[1:4,]
    a b band X
  1 1 1  foo 1
  2 2 1  foo 2
  3 3 1  foo 3
  4 1 2  foo 4
  > try(x <- st_bbox(st)) # error
  Error in st_bbox.dimensions(st_dimensions(obj), ...) : 
    dimensions table does not have x & y, nor an sfc dimension
  > 
  > # regular, geotransform:
  > d = st_dimensions(x = 1:3, y = 1:3, band = c("foo", "bar"), .raster = c("x", "y"))
  > (st = st_as_stars(array(1:18, c(3,3,2)), dimension = d))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  X     1    5.25    9.5  9.5   13.75   18
  dimension(s):
       from to offset delta point   values x/y
  x       1  3      1     1 FALSE     NULL [x]
  y       1  3      1     1 FALSE     NULL [y]
  band    1  2     NA    NA FALSE foo, bar    
  > as.data.frame(st, add_max=FALSE)[1:4,]
      x   y band X
  1 1.5 1.5  foo 1
  2 2.5 1.5  foo 2
  3 3.5 1.5  foo 3
  4 1.5 2.5  foo 4
  > as.data.frame(st, add_max=TRUE)[1:4,]
    x y band x_max y_max X
  1 1 1  foo     2     2 1
  2 2 1  foo     3     2 2
  3 3 1  foo     4     2 3
  4 1 2  foo     2     3 4
  > st_bbox(st)
  xmin ymin xmax ymax 
     1    1    4    4 
  > 
  > # rectilinear with offset given:
  > xd = c(1, 2, 4)
  > d = st_dimensions(x = xd, y = 1:3, band = c("foo", "bar"), .raster = c("x", "y"))
  > (st = st_as_stars(array(1:18, c(3,3,2)), dimension = d))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  X     1    5.25    9.5  9.5   13.75   18
  dimension(s):
       from to offset delta point              values x/y
  x       1  3     NA    NA FALSE [1,2), [2,4), [4,6) [x]
  y       1  3      1     1 FALSE                NULL [y]
  band    1  2     NA    NA FALSE            foo, bar    
  > as.data.frame(st, add_max=FALSE)[1:4,]
      x   y band X
  1 1.5 1.5  foo 1
  2 3.0 1.5  foo 2
  3 5.0 1.5  foo 3
  4 1.5 2.5  foo 4
  > as.data.frame(st, add_max=TRUE)[1:4,]
    x y band x_max y_max X
  1 1 1  foo     2     2 1
  2 2 1  foo     4     2 2
  3 4 1  foo     6     2 3
  4 1 2  foo     2     3 4
  > st_bbox(st)
  xmin ymin xmax ymax 
     1    1    6    4 
  > 
  > # rectilinear with midpoints given:
  > xd = c(1, 2, 4)
  > d = st_dimensions(x = xd, y = 1:3, band = c("foo", "bar"), .raster = c("x", "y"), cell_midpoints = TRUE)
  > (st = st_as_stars(array(1:18, c(3,3,2)), dimension = d))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  X     1    5.25    9.5  9.5   13.75   18
  dimension(s):
       from to offset delta point                          values x/y
  x       1  3     NA    NA FALSE [0.5,1.5), [1.5,3.0), [3.0,5.0) [x]
  y       1  3    0.5     1 FALSE                            NULL [y]
  band    1  2     NA    NA FALSE                        foo, bar    
  > as.data.frame(st, add_max=FALSE)[1:4,]
       x y band X
  1 1.00 1  foo 1
  2 2.25 1  foo 2
  3 4.00 1  foo 3
  4 1.00 2  foo 4
  > as.data.frame(st, add_max=TRUE)[1:4,]
      x   y band x_max y_max X
  1 0.5 0.5  foo   1.5   1.5 1
  2 1.5 0.5  foo   3.0   1.5 2
  3 3.0 0.5  foo   5.0   1.5 3
  4 0.5 1.5  foo   1.5   2.5 4
  > st_bbox(st)
  xmin ymin xmax ymax 
   0.5  0.5  5.0  3.5 
  > 
  > # rectilinear with midpoints given, point support
  > xd = c(1, 2, 4)
  > d = st_dimensions(x = xd, y = 1:3, band = c("foo", "bar"), .raster = c("x", "y"), cell_midpoints = TRUE, point = TRUE)
  > (st = st_as_stars(array(1:18, c(3,3,2)), dimension = d))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  X     1    5.25    9.5  9.5   13.75   18
  dimension(s):
       from to offset delta point   values x/y
  x       1  3     NA    NA  TRUE  1, 2, 4 [x]
  y       1  3    0.5     1  TRUE     NULL [y]
  band    1  2     NA    NA  TRUE foo, bar    
  > as.data.frame(st, add_max=FALSE)[1:4,]
    x y band X
  1 1 1  foo 1
  2 2 1  foo 2
  3 4 1  foo 3
  4 1 2  foo 4
  > as.data.frame(st, add_max=TRUE)[1:4,]
    x   y band x_max y_max X
  1 1 0.5  foo     1   1.5 1
  2 2 0.5  foo     2   1.5 2
  3 4 0.5  foo     4   1.5 3
  4 1 1.5  foo     1   2.5 4
  > st_bbox(st)
  xmin ymin xmax ymax 
   1.0  0.5  4.0  3.5 
  > 
  > # rectilinear with start/end given:
  > #xd = stars:::make_intervals(start = c(1,2,4), end = c(2, 4, 8))
  > xd = c(1, 2, 4, 8) # one more than dim of the data array
  > d = st_dimensions(x = xd, y = 1:3, band = c("foo", "bar"), .raster = c("x", "y"))
  > (st = st_as_stars(array(1:18, c(3,3,2)), dimension = d))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  X     1    5.25    9.5  9.5   13.75   18
  dimension(s):
       from to offset delta point              values x/y
  x       1  3     NA    NA FALSE [1,2), [2,4), [4,8) [x]
  y       1  3      1     1 FALSE                NULL [y]
  band    1  2     NA    NA FALSE            foo, bar    
  > as.data.frame(st, add_max=FALSE)[1:4,]
      x   y band X
  1 1.5 1.5  foo 1
  2 3.0 1.5  foo 2
  3 6.0 1.5  foo 3
  4 1.5 2.5  foo 4
  > as.data.frame(st, add_max=TRUE)[1:4,]
    x y band x_max y_max X
  1 1 1  foo     2     2 1
  2 2 1  foo     4     2 2
  3 4 1  foo     8     2 3
  4 1 2  foo     2     3 4
  > st_bbox(st)
  xmin ymin xmax ymax 
     1    1    8    4 
  > 
  > # with sfc:
  > sfc = st_sfc(st_point(0:1), st_point(2:1), st_point(4:3))
  > d = st_dimensions(x = sfc, y = 1:3, band = c("foo", "bar"))
  > (st = st_as_stars(array(1:18, c(3,3,2)), dimension = d))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  X     1    5.25    9.5  9.5   13.75   18
  dimension(s):
       from to offset delta point                      values
  x       1  3     NA    NA  TRUE POINT (0 1),...,POINT (4 3)
  y       1  3      1     1 FALSE                        NULL
  band    1  2     NA    NA FALSE                    foo, bar
  > as.data.frame(st, add_max=FALSE)[1:4,]
              x y band X
  1 POINT (0 1) 1  foo 1
  2 POINT (2 1) 1  foo 2
  3 POINT (4 3) 1  foo 3
  4 POINT (0 1) 2  foo 4
  > st_as_sf(st, long = TRUE)[1:4,]
  Simple feature collection with 4 features and 3 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 4 ymax: 3
  CRS:           NA
    y band X           x
  1 1  foo 1 POINT (0 1)
  2 1  foo 2 POINT (2 1)
  3 1  foo 3 POINT (4 3)
  4 2  foo 4 POINT (0 1)
  > st_bbox(st)
  xmin ymin xmax ymax 
     0    1    4    3 
  > 
  > # rotated/sheared:
  > d = st_dimensions(x = 1:3, y = 1:3, band = c("foo", "bar"), .raster = c("x", "y"), affine = c(0.2, -0.2))
  > (st = st_as_stars(array(1:18, c(3,3,2)), dimension = d))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  X     1    5.25    9.5  9.5   13.75   18
  dimension(s):
       from to offset delta point   values x/y
  x       1  3      1     1 FALSE     NULL [x]
  y       1  3      1     1 FALSE     NULL [y]
  band    1  2     NA    NA FALSE foo, bar    
  sheared raster with parameters: 0.2 -0.2 
  > as.data.frame(st, add_max=FALSE)[1:4,]
      x   y X
  1 1.6 1.4 1
  2 2.6 1.2 2
  3 3.6 1.0 3
  4 1.8 2.4 4
  > try(as.data.frame(st, add_max=TRUE)[1:4,]) # errors
  Error in st_coordinates.stars(x, add_max = add_max, center = center, ...) : 
    add_max will not work for rotated/shared rasters
  > st_bbox(st)
  xmin ymin xmax ymax 
   1.0  0.4  4.6  4.0 
  > 
  > # curvilinear:
  > set.seed(13531)
  > lon = st_as_stars(matrix(signif(runif(9), 2), 3, 3))
  > lat = st_as_stars(matrix(signif(runif(9), 2), 3, 3))
  > ll = setNames(c(lon, lat), c("lon", "lat"))
  > d = st_dimensions(lon = 1:3, lat = 1:3)
  > a = st_as_stars(list(X = array(1:9, c(3,3))), dimensions = d)
  > (st = st_as_stars(a, curvilinear = ll))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  X     1       3      5    5       7    9
  dimension(s):
      from to         refsys point               values x/y
  lon    1  3 WGS 84 (CRS84) FALSE  [3x3] 0.03,...,0.89 [x]
  lat    1  3 WGS 84 (CRS84) FALSE [3x3] 0.021,...,0.89 [y]
  curvilinear grid
  > as.data.frame(st)
     lon   lat X
  1 0.89 0.250 1
  2 0.64 0.510 2
  3 0.30 0.670 3
  4 0.69 0.890 4
  5 0.47 0.890 5
  6 0.26 0.190 6
  7 0.57 0.021 7
  8 0.27 0.220 8
  9 0.03 0.340 9
  > st_bbox(st)
   xmin  ymin  xmax  ymax 
  0.030 0.021 0.890 0.890 
  > 
  > # time regular:
  > t = as.Date("2019-01-20") + 0:3
  > d = st_dimensions(t, sfc)
  > (st = st_as_stars(list(a = matrix(1:12, 4, 3)), dimensions = d))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  a     1    3.75    6.5  6.5    9.25   12
  dimension(s):
     from to     offset  delta refsys point                      values
  X1    1  4 2019-01-20 1 days   Date FALSE                        NULL
  X2    1  3         NA     NA     NA  TRUE POINT (0 1),...,POINT (4 3)
  > as.data.frame(st)
             X1          X2  a
  1  2019-01-20 POINT (0 1)  1
  2  2019-01-21 POINT (0 1)  2
  3  2019-01-22 POINT (0 1)  3
  4  2019-01-23 POINT (0 1)  4
  5  2019-01-20 POINT (2 1)  5
  6  2019-01-21 POINT (2 1)  6
  7  2019-01-22 POINT (2 1)  7
  8  2019-01-23 POINT (2 1)  8
  9  2019-01-20 POINT (4 3)  9
  10 2019-01-21 POINT (4 3) 10
  11 2019-01-22 POINT (4 3) 11
  12 2019-01-23 POINT (4 3) 12
  > 
  > # time, rectilinear
  > t = as.Date("2019-01-20") + c(0, 2, 3, 10)
  > d = st_dimensions(t, sfc)
  > (st = st_as_stars(list(a = matrix(1:12, 4, 3)), dimensions = d))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
     Min. 1st Qu. Median Mean 3rd Qu. Max.
  a     1    3.75    6.5  6.5    9.25   12
  dimension(s):
     from to refsys point                      values
  X1    1  4   Date FALSE   2019-01-20,...,2019-01-30
  X2    1  3     NA  TRUE POINT (0 1),...,POINT (4 3)
  > as.data.frame(st)
             X1          X2  a
  1  2019-01-20 POINT (0 1)  1
  2  2019-01-22 POINT (0 1)  2
  3  2019-01-23 POINT (0 1)  3
  4  2019-01-30 POINT (0 1)  4
  5  2019-01-20 POINT (2 1)  5
  6  2019-01-22 POINT (2 1)  6
  7  2019-01-23 POINT (2 1)  7
  8  2019-01-30 POINT (2 1)  8
  9  2019-01-20 POINT (4 3)  9
  10 2019-01-22 POINT (4 3) 10
  11 2019-01-23 POINT (4 3) 11
  12 2019-01-30 POINT (4 3) 12
  > 
  > proc.time()
     user  system elapsed 
     1.35    0.26    1.61 
Running the tests in 'tests/mdim.R' failed.
Complete output:
  > Sys.setenv(TZ="")
  > suppressPackageStartupMessages(library(stars))
  > matrix(1:4,2)
       [,1] [,2]
  [1,]    1    3
  [2,]    2    4
  > m = matrix(1:4,2)
  > s = st_as_stars(m)
  > 
  > s = st_set_dimensions(s, st_dimensions(s), xy = NULL) 
  > sfc = st_sfc(st_point(0:1), st_point(3:2))
  > s = st_set_dimensions(s, 1, sfc) |> st_set_crs(4326)
  > tm = as.POSIXct("2023-03-04 12:35") + c(0, 3600)
  > (s = st_set_dimensions(s, 2, tm))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1     1    1.75    2.5  2.5    3.25    4
  dimension(s):
     from to                  offset   delta  refsys point
  X1    1  2                      NA      NA  WGS 84  TRUE
  X2    1  2 2023-03-04 12:35:00 CET 1 hours POSIXct FALSE
                       values
  X1 POINT (0 1), POINT (3 2)
  X2                     NULL
  > f = tempfile(fileext = ".nc")
  > if (compareVersion(sf_extSoftVersion()["GDAL"], "3.4.0") > -1) {
  +  write_mdim(s, f, as_float = FALSE)
  +  s2 = read_mdim(f)
  +  print(s2)
  +  print(all.equal(s, s2, check.attributes = FALSE))
  +  print(all.equal(s, s2))
  + 
  +  st_crs(sfc) = st_crs(s2)
  +  st_crs(s) = st_crs(s2)
  +  tm = as.Date("2023-02-25") + 0:1
  +  sd = st_set_dimensions(s, 2, tm)
  +  print(sd)
  +  sd = st_set_dimensions(sd, 1, sfc)
  +  print(sd)
  +  f = tempfile(fileext = ".nc")
  +  write_mdim(sd, f)
  +  sd2 = read_mdim(f)
  +  print(sd2)
  +  print(all.equal(sd, sd2, check.attributes = FALSE))
  +  print(all.equal(sd, sd2))
  + }
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1     1    1.75    2.5  2.5    3.25    4
  dimension(s):
     from to                  offset   delta  refsys point
  X1    1  2                      NA      NA  WGS 84  TRUE
  X2    1  2 2023-03-04 11:35:00 UTC 1 hours POSIXct    NA
                       values
  X1 POINT (0 1), POINT (3 2)
  X2                     NULL
  [1] TRUE
  [1] "Attributes: < Component \"dimensions\": Component \"X1\": Component \"refsys\": Component \"input\": 1 string mismatch >"                                   
  [2] "Attributes: < Component \"dimensions\": Component \"X1\": Component \"refsys\": Component \"wkt\": 1 string mismatch >"                                     
  [3] "Attributes: < Component \"dimensions\": Component \"X1\": Component \"values\": Attributes: < Component \"crs\": Component \"input\": 1 string mismatch > >"
  [4] "Attributes: < Component \"dimensions\": Component \"X1\": Component \"values\": Attributes: < Component \"crs\": Component \"wkt\": 1 string mismatch > >"  
  [5] "Attributes: < Component \"dimensions\": Component \"X2\": Component \"offset\": 'tzone' attributes are inconsistent ('' and 'UTC') >"                       
  [6] "Attributes: < Component \"dimensions\": Component \"X2\": Component \"point\": 'is.NA' value mismatch: 1 in current 0 in target >"                          
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1     1    1.75    2.5  2.5    3.25    4
  dimension(s):
     from to     offset  delta refsys point                   values
  X1    1  2         NA     NA WGS 84  TRUE POINT (0 1), POINT (3 2)
  X2    1  2 2023-02-25 1 days   Date FALSE                     NULL
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1     1    1.75    2.5  2.5    3.25    4
  dimension(s):
     from to     offset  delta refsys point                   values
  X1    1  2         NA     NA WGS 84  TRUE POINT (0 1), POINT (3 2)
  X2    1  2 2023-02-25 1 days   Date FALSE                     NULL
  stars object with 2 dimensions and 1 attribute
  attribute(s):
      Min. 1st Qu. Median Mean 3rd Qu. Max.
  A1     1    1.75    2.5  2.5    3.25    4
  dimension(s):
     from to     offset  delta refsys point                   values
  X1    1  2         NA     NA WGS 84  TRUE POINT (0 1), POINT (3 2)
  X2    1  2 2023-02-25 1 days   Date    NA                     NULL
  [1] TRUE
  [1] "Attributes: < Component \"dimensions\": Component \"X2\": Component \"point\": 'is.NA' value mismatch: 1 in current 0 in target >"
  Warning messages:
  1: In CPL_write_mdim(file, driver, dimx, cdl, wkt, xy, root_group_options,  :
    GDAL Error 6: SetIndexingVariable() not implemented
  2: In CPL_write_mdim(file, driver, dimx, cdl, wkt, xy, root_group_options,  :
    GDAL Error 6: SetIndexingVariable() not implemented
  3: In CPL_write_mdim(file, driver, dimx, cdl, wkt, xy, root_group_options,  :
    GDAL Error 6: SetIndexingVariable() not implemented
  4: In CPL_write_mdim(file, driver, dimx, cdl, wkt, xy, root_group_options,  :
    GDAL Error 6: SetIndexingVariable() not implemented
  > 
  > proc.time()
     user  system elapsed 
     1.26    0.25    1.51 
Running the tests in 'tests/predict.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(stars))
  > # predict:
  > tif = system.file("tif/L7_ETMs.tif", package = "stars")
  > (x = read_stars(tif))
  stars object with 3 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median     Mean 3rd Qu. Max.
  L7_ETMs.tif     1      54     69 68.91242      86  255
  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    
  > st_crs(x) = st_crs(x) # cleans trailing space
  > model = lm(x~L7_ETMs.tif, head(as.data.frame(x), 50))
  > x = predict(x, model)
  > 
  > (y = read_stars(tif, proxy = TRUE))
  stars_proxy object with 1 attribute in 1 file(s):
  $L7_ETMs.tif
  [1] "[...]/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    
  > (yp = predict(y, model))
  stars_proxy object with 1 attribute in 1 file(s):
  $L7_ETMs.tif
  [1] "[...]/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    
  call_list:
  [[1]]
  predict(object = object, model = model)
  attr(,".Environment")
  <environment: 0x00000244cb058318>
  
  This object has pending lazy operations: dimensions as printed may not reflect this.
  > all.equal(x, st_as_stars(yp))
  [1] TRUE
  > 
  > yy = st_set_dimensions(y, 3, values = paste0("band", 1:6))
  > (y_spl = split(yy, 3))
  stars_proxy object with 1 attribute in 1 file(s):
  $L7_ETMs.tif
  [1] "[...]/L7_ETMs.tif"
  
  dimension(s):
       from  to  offset delta                     refsys point          values
  x       1 349  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE            NULL
  y       1 352 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE            NULL
  band    1   6      NA    NA                         NA    NA band1,...,band6
       x/y
  x    [x]
  y    [y]
  band    
  call_list:
  [[1]]
  split(x = x, 3)
  attr(,".Environment")
  <environment: 0x00000244cb854510>
  
  This object has pending lazy operations: dimensions as printed may not reflect this.
  > as.data.frame(st_as_stars(split(yy, 3)))[1:3,]
           x       y band1 band2 band3 band4 band5 band6
  1 288790.5 9120747    69    56    46    79    86    46
  2 288819.0 9120747    69    57    49    75    88    49
  3 288847.5 9120747    63    52    45    66    75    41
  > 
  > proc.time()
     user  system elapsed 
     3.43    0.60    4.03 
Running the tests in 'tests/redimension.R' failed.
Complete output:
  > 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.87    0.18    2.06 
Running the tests in 'tests/sp.R' failed.
Complete output:
  > options(rgdal_show_exportToProj4_warnings = "none")
  > if (suppressPackageStartupMessages(require(sp, quietly = TRUE))) {
  + demo(meuse)
  + # remove +init=xxx
  + meuse@proj4string = CRS(
  + "+proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs"
  + )
  + meuse.grid@proj4string = CRS(
  + "+proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs"
  + )
  + 
  + suppressPackageStartupMessages(library(stars))
  + (m = st_as_stars(meuse))
  + (gr = st_as_stars(meuse.grid))
  + 
  + m2 = as(m, "Spatial")
  + summary(m2)
  + gr2 = as(gr, "Spatial")
  + summary(gr2)
  + 
  + all.equal(meuse, m2, check.attributes = FALSE)
  + fullgrid(meuse.grid) = TRUE
  + all.equal(meuse.grid, gr2, check.attributes = FALSE)
  + 
  + #all.equal(meuse, m2)
  + #all.equal(meuse.grid, gr2)
  + }
  
  
  	demo(meuse)
  	---- ~~~~~
  
  > require(sp)
  
  > crs = CRS("EPSG:28992")
  
  > data("meuse")
  
  > coordinates(meuse) <- ~x+y
  
  > proj4string(meuse) <- crs
  
  > data("meuse.grid")
  
  > coordinates(meuse.grid) <- ~x+y
  
  > gridded(meuse.grid) <- TRUE
  
  > proj4string(meuse.grid) <- crs
  
  > data("meuse.riv")
  
  > meuse.riv <- SpatialPolygons(list(Polygons(list(Polygon(meuse.riv)),"meuse.riv")))
  
  > proj4string(meuse.riv) <- crs
  
  > data("meuse.area")
  
  > meuse.area = SpatialPolygons(list(Polygons(list(Polygon(meuse.area)), "area")))
  
  > proj4string(meuse.area) <- crs
  [1] TRUE
  > 
  > proc.time()
     user  system elapsed 
     1.87    0.26    2.12 
Running the tests in 'tests/spacetime.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(stars))
  > if (suppressPackageStartupMessages(require(sp, quietly = TRUE)) && require(spacetime, quietly = TRUE)) {
  + set.seed(1331)
  + Sys.setenv(TZ="UTC")
  + example(STFDF)
  + 
  + x = st_as_stars(stfdf)
  + xx = as(x, "STFDF")
  + 
  + # as.xts.stars:
  + library(xts)
  + xts = as.xts(x)
  + st_as_stars(xts)
  + st_as_stars(xts, dimensions = st_dimensions(x))
  + 
  + library(sp)
  + pts = SpatialPoints(rbind(c(0,0), c(0,1), c(1,0), c(1,1)))
  + gridded(pts) = TRUE
  + 
  + tm = xts(1:10, as.Date("2010-01-01")+0:9)
  + stfdf = STFDF(pts, tm, data.frame(foo = seq_len(length(pts) * length(tm))))
  + x = st_as_stars(stfdf)
  + xx = as(x, "STFDF")
  + 
  + x = st_as_stars(as(stfdf, "STSDF"))
  + }
  
  STFDF> sp = cbind(x = c(0,0,1), y = c(0,1,1))
  
  STFDF> row.names(sp) = paste("point", 1:nrow(sp), sep="")
  
  STFDF> library(sp)
  
  STFDF> sp = SpatialPoints(sp)
  
  STFDF> time = as.POSIXct("2010-08-05")+3600*(10:13)
  
  STFDF> m = c(10,20,30) # means for each of the 3 point locations
  
  STFDF> mydata = rnorm(length(sp)*length(time),mean=rep(m, 4))
  
  STFDF> IDs = paste("ID",1:length(mydata))
  
  STFDF> mydata = data.frame(values = signif(mydata,3), ID=IDs)
  
  STFDF> stfdf = STFDF(sp, time, mydata)
  
  STFDF> stfdf
  An object of class "STFDF"
  Slot "data":
     values    ID
  1    9.38  ID 1
  2   21.10  ID 2
  3   29.80  ID 3
  4   11.50  ID 4
  5   19.80  ID 5
  6   31.20  ID 6
  7   10.40  ID 7
  8   20.50  ID 8
  9   29.80  ID 9
  10  10.30 ID 10
  11  21.40 ID 11
  12  29.40 ID 12
  
  Slot "sp":
  SpatialPoints:
         x y
  point1 0 0
  point2 0 1
  point3 1 1
  Coordinate Reference System (CRS) arguments: NA 
  
  Slot "time":
                      timeIndex
  2010-08-05 10:00:00         1
  2010-08-05 11:00:00         2
  2010-08-05 12:00:00         3
  2010-08-05 13:00:00         4
  
  Slot "endTime":
  [1] "2010-08-05 11:00:00 UTC" "2010-08-05 12:00:00 UTC"
  [3] "2010-08-05 13:00:00 UTC" "2010-08-05 14:00:00 UTC"
  
  
  STFDF> stfdf[1:2,]
  An object of class "STFDF"
  Slot "data":
    values    ID
  1   9.38  ID 1
  2  21.10  ID 2
  3  11.50  ID 4
  4  19.80  ID 5
  5  10.40  ID 7
  6  20.50  ID 8
  7  10.30 ID 10
  8  21.40 ID 11
  
  Slot "sp":
  SpatialPoints:
         x y
  point1 0 0
  point2 0 1
  Coordinate Reference System (CRS) arguments: NA 
  
  Slot "time":
                      timeIndex
  2010-08-05 10:00:00         1
  2010-08-05 11:00:00         2
  2010-08-05 12:00:00         3
  2010-08-05 13:00:00         4
  
  Slot "endTime":
  [1] "2010-08-05 11:00:00 UTC" "2010-08-05 12:00:00 UTC"
  [3] "2010-08-05 13:00:00 UTC" "2010-08-05 14:00:00 UTC"
  
  
  STFDF> stfdf[,1:2]
  An object of class "STFDF"
  Slot "data":
    values   ID
  1   9.38 ID 1
  2  21.10 ID 2
  3  29.80 ID 3
  4  11.50 ID 4
  5  19.80 ID 5
  6  31.20 ID 6
  
  Slot "sp":
  SpatialPoints:
         x y
  point1 0 0
  point2 0 1
  point3 1 1
  Coordinate Reference System (CRS) arguments: NA 
  
  Slot "time":
                      timeIndex
  2010-08-05 10:00:00         1
  2010-08-05 11:00:00         2
  
  Slot "endTime":
  [1] "2010-08-05 11:00:00 UTC" "2010-08-05 12:00:00 UTC"
  
  
  STFDF> stfdf[,,2]
  An object of class "STFDF"
  Slot "data":
        ID
  1   ID 1
  2   ID 2
  3   ID 3
  4   ID 4
  5   ID 5
  6   ID 6
  7   ID 7
  8   ID 8
  9   ID 9
  10 ID 10
  11 ID 11
  12 ID 12
  
  Slot "sp":
  SpatialPoints:
         x y
  point1 0 0
  point2 0 1
  point3 1 1
  Coordinate Reference System (CRS) arguments: NA 
  
  Slot "time":
                      timeIndex
  2010-08-05 10:00:00         1
  2010-08-05 11:00:00         2
  2010-08-05 12:00:00         3
  2010-08-05 13:00:00         4
  
  Slot "endTime":
  [1] "2010-08-05 11:00:00 UTC" "2010-08-05 12:00:00 UTC"
  [3] "2010-08-05 13:00:00 UTC" "2010-08-05 14:00:00 UTC"
  
  
  STFDF> stfdf[,,"values"]
  An object of class "STFDF"
  Slot "data":
     values
  1    9.38
  2   21.10
  3   29.80
  4   11.50
  5   19.80
  6   31.20
  7   10.40
  8   20.50
  9   29.80
  10  10.30
  11  21.40
  12  29.40
  
  Slot "sp":
  SpatialPoints:
         x y
  point1 0 0
  point2 0 1
  point3 1 1
  Coordinate Reference System (CRS) arguments: NA 
  
  Slot "time":
                      timeIndex
  2010-08-05 10:00:00         1
  2010-08-05 11:00:00         2
  2010-08-05 12:00:00         3
  2010-08-05 13:00:00         4
  
  Slot "endTime":
  [1] "2010-08-05 11:00:00 UTC" "2010-08-05 12:00:00 UTC"
  [3] "2010-08-05 13:00:00 UTC" "2010-08-05 14:00:00 UTC"
  
  
  STFDF> stfdf[1,]
                      values    ID timeIndex
  2010-08-05 10:00:00   9.38  ID 1         1
  2010-08-05 11:00:00  11.50  ID 4         2
  2010-08-05 12:00:00  10.40  ID 7         3
  2010-08-05 13:00:00  10.30 ID 10         4
  
  STFDF> stfdf[,2]
    coordinates values   ID
  1      (0, 0)   11.5 ID 4
  2      (0, 1)   19.8 ID 5
  3      (1, 1)   31.2 ID 6
  
  STFDF> as(stfdf[,,1], "xts")
                      point1 point2 point3
  2010-08-05 10:00:00   9.38   21.1   29.8
  2010-08-05 11:00:00  11.50   19.8   31.2
  2010-08-05 12:00:00  10.40   20.5   29.8
  2010-08-05 13:00:00  10.30   21.4   29.4
  
  STFDF> as(stfdf[,,2], "xts")
                      point1 point2 point3
  2010-08-05 10:00:00   ID 1   ID 2   ID 3
  2010-08-05 11:00:00   ID 4   ID 5   ID 6
  2010-08-05 12:00:00   ID 7   ID 8   ID 9
  2010-08-05 13:00:00  ID 10  ID 11  ID 12
  
  STFDF> # examples for [[, [[<-, $ and $<- 
  STFDF> stfdf[[1]]
   [1]  9.38 21.10 29.80 11.50 19.80 31.20 10.40 20.50 29.80 10.30 21.40 29.40
  
  STFDF> stfdf[["values"]]
   [1]  9.38 21.10 29.80 11.50 19.80 31.20 10.40 20.50 29.80 10.30 21.40 29.40
  
  STFDF> stfdf[["newVal"]] <- rnorm(12)
  
  STFDF> stfdf$ID
   [1] "ID 1"  "ID 2"  "ID 3"  "ID 4"  "ID 5"  "ID 6"  "ID 7"  "ID 8"  "ID 9" 
  [10] "ID 10" "ID 11" "ID 12"
  
  STFDF> stfdf$ID = paste("OldIDs", 1:12, sep="")
  
  STFDF> stfdf$NewID = paste("NewIDs", 12:1, sep="")
  
  STFDF> stfdf
  An object of class "STFDF"
  Slot "data":
     values       ID     newVal    NewID
  1    9.38  OldIDs1 -0.3125824 NewIDs12
  2   21.10  OldIDs2 -1.0536246 NewIDs11
  3   29.80  OldIDs3 -0.7188880 NewIDs10
  4   11.50  OldIDs4 -1.0525404  NewIDs9
  5   19.80  OldIDs5 -0.8441413  NewIDs8
  6   31.20  OldIDs6  1.1420848  NewIDs7
  7   10.40  OldIDs7  1.9479070  NewIDs6
  8   20.50  OldIDs8 -0.4512836  NewIDs5
  9   29.80  OldIDs9  0.6695716  NewIDs4
  10  10.30 OldIDs10  0.1269003  NewIDs3
  11  21.40 OldIDs11 -0.7273297  NewIDs2
  12  29.40 OldIDs12 -0.8151803  NewIDs1
  
  Slot "sp":
  SpatialPoints:
         x y
  point1 0 0
  point2 0 1
  point3 1 1
  Coordinate Reference System (CRS) arguments: NA 
  
  Slot "time":
                      timeIndex
  2010-08-05 10:00:00         1
  2010-08-05 11:00:00         2
  2010-08-05 12:00:00         3
  2010-08-05 13:00:00         4
  
  Slot "endTime":
  [1] "2010-08-05 11:00:00 UTC" "2010-08-05 12:00:00 UTC"
  [3] "2010-08-05 13:00:00 UTC" "2010-08-05 14:00:00 UTC"
  
  
  STFDF> x = stfdf[stfdf[1:2,],] 
  
  STFDF> all.equal(x, stfdf[1:2,]) 
  [1] TRUE
  
  STFDF> all.equal(stfdf, stfdf[stfdf,]) # converts character to factor...
  [1] TRUE
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  only the first attribute will used; maybe use merge() first?
  > 
  > proc.time()
     user  system elapsed 
     2.32    0.42    2.75 
Running the tests in 'tests/spatstat.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(sf))
  > 
  > library(stars)
  Loading required package: abind
  > if (suppressPackageStartupMessages(require(spatstat.geom, quietly = TRUE))) {
  + tif = system.file("tif/L7_ETMs.tif", package = "stars")
  + s = adrop(read_stars(tif)[,,,1]) > 70
  + plot(s)
  + m = as.owin(s)
  + plot(m)
  + print(table(m$m))
  + }
  
  FALSE  TRUE 
  39494 83354 
  > 
  > proc.time()
     user  system elapsed 
     2.78    0.32    3.07 
Running the tests in 'tests/subset.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(stars))
  > tif = system.file("tif/L7_ETMs.tif", package = "stars")
  > x = read_stars(tif)
  > y = st_set_dimensions(x, "band", point = TRUE)
  > y[,1:10, 1:10, c(1,4,3,2)]
  stars object with 3 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median   Mean 3rd Qu. Max.
  L7_ETMs.tif    25      45     57 56.535      64   97
  dimension(s):
       from to  offset delta                     refsys point  values x/y
  x       1 10  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE    NULL [x]
  y       1 10 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE    NULL [y]
  band    1  4      NA    NA                         NA  TRUE 1,...,2    
  > y = st_set_dimensions(x, "band", point = NA)
  > y[,1:10, 1:10, c(1,4,3,2)]
  stars object with 3 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median   Mean 3rd Qu. Max.
  L7_ETMs.tif    25      45     57 56.535      64   97
  dimension(s):
       from to  offset delta                     refsys point          values x/y
  x       1 10  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE            NULL [x]
  y       1 10 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE            NULL [y]
  band    1  4      NA    NA                         NA    NA [1,2),...,[2,3)    
  > y = st_set_dimensions(x, "band", point = FALSE)
  > y[,1:10, 1:10, c(1,4,3,2)]
  stars object with 3 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median   Mean 3rd Qu. Max.
  L7_ETMs.tif    25      45     57 56.535      64   97
  dimension(s):
       from to  offset delta                     refsys point          values x/y
  x       1 10  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE            NULL [x]
  y       1 10 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE            NULL [y]
  band    1  4      NA    NA                         NA FALSE [1,2),...,[2,3)    
  > y = st_set_dimensions(x, "band", values = letters[1:6])
  > y[,1:10, 1:10, c(1,4,3,2)]
  stars object with 3 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median   Mean 3rd Qu. Max.
  L7_ETMs.tif    25      45     57 56.535      64   97
  dimension(s):
       from to  offset delta                     refsys point  values x/y
  x       1 10  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE    NULL [x]
  y       1 10 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE    NULL [y]
  band    1  4      NA    NA                         NA    NA a,...,b    
  > y = st_set_dimensions(x, "band", values = letters[1:6], point = NA)
  > y[,1:10, 1:10, c(1,4,3,2)]
  stars object with 3 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median   Mean 3rd Qu. Max.
  L7_ETMs.tif    25      45     57 56.535      64   97
  dimension(s):
       from to  offset delta                     refsys point  values x/y
  x       1 10  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE    NULL [x]
  y       1 10 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE    NULL [y]
  band    1  4      NA    NA                         NA    NA a,...,b    
  > y = st_set_dimensions(x, "band", values = letters[1:6], point = TRUE)
  > y[,1:10, 1:10, c(1,4,3,2)]
  stars object with 3 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median   Mean 3rd Qu. Max.
  L7_ETMs.tif    25      45     57 56.535      64   97
  dimension(s):
       from to  offset delta                     refsys point  values x/y
  x       1 10  288776  28.5 SIRGAS 2000 / UTM zone 25S FALSE    NULL [x]
  y       1 10 9120761 -28.5 SIRGAS 2000 / UTM zone 25S FALSE    NULL [y]
  band    1  4      NA    NA                         NA  TRUE a,...,b    
  > 
  > proc.time()
     user  system elapsed 
     1.81    0.39    2.18 
Running the tests in 'tests/tidy.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(stars))
  > 
  > if (require(dplyr, quietly = TRUE)) {
  + tif = system.file("tif/L7_ETMs.tif", package = "stars")
  + x <- read_stars(tif)
  + (y <- x %>% select(L7_ETMs.tif))
  + (y <- x %>% filter(band > 2))
  + (z <- x %>% mutate(foo = 2* L7_ETMs.tif))
  + x %>% pull(L7_ETMs.tif) %>% class()
  + x %>% filter(x > 289900)
  + x %>% slice("x", 50:100)
  + 
  + suppressPackageStartupMessages(library(ggplot2))
  + ggplot() + geom_stars(data = x) + coord_equal() + facet_wrap(~band)
  + ggplot() + geom_stars(data = x[,c(1:50,52:100),c(1:45, 50:60)]) +
  + 	coord_equal()
  + ggplot() + geom_stars(data = x[,1:10,1:10,1:2], sf = TRUE) + facet_wrap(~band)
  + 
  + 
  + # see https://github.com/r-spatial/stars/issues/539 :
  + x <- read_stars(system.file("tif/L7_ETMs.tif", package = "stars"))
  + y <- transmute(x, L7_ETMs.tif = units::set_units(L7_ETMs.tif, degree_C)) # same as x but with units
  + 
  + x - slice(x, 'band', 1) # runs as expected, recycling the second object
  + try(y - slice(x, 'band', 1)) # fails as expected because x is unitless
  + try(x - slice(y, 'band', 1)) # fails as expected 
  + y - slice(y, 'band', 1) # runs as expected
  + }
  
  Attaching package: 'dplyr'
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  Error in Ops.units(X[[i]], ...) : 
    both operands of the expression should be "units" objects
  Error in Ops.units(X[[i]], ...) : 
    both operands of the expression should be "units" objects
  stars object with 3 dimensions and 1 attribute
  attribute(s):
                   Min. 1st Qu. Median     Mean 3rd Qu. Max.
  L7_ETMs.tif [°C] -184     -19     -8 -10.2353       0  131
  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    
  > 
  > proc.time()
     user  system elapsed 
     1.76    0.40    2.15 
Running the tests in 'tests/transform.R' failed.
Complete output:
  > suppressPackageStartupMessages(library(stars))
  > suppressPackageStartupMessages(library(lwgeom))
  Warning message:
  In fun(libname, pkgname) :
    GEOS versions differ: lwgeom has 3.12.1 sf has 3.11.2
  > geomatrix = system.file("tif/geomatrix.tif", package = "stars")
  > (x = read_stars(geomatrix))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
                 Min. 1st Qu. Median    Mean 3rd Qu. Max.
  geomatrix.tif    74     107    123 126.765     132  255
  dimension(s):
    from to  offset delta                refsys point x/y
  x    1 20 1841002   1.5 WGS 84 / UTM zone 11N  TRUE [x]
  y    1 20 1144003  -1.5 WGS 84 / UTM zone 11N  TRUE [y]
  sheared raster with parameters: -5 -5 
  > new = st_crs(4326)
  > y = st_transform(x, new)
  > plot(st_transform(st_as_sfc(st_bbox(x)), new), col = NA, border = 'red')
  > plot(st_as_sfc(y, as_points=FALSE), col = NA, border = 'green', axes = TRUE, add = TRUE)
  > image(y, add = TRUE)
  > plot(st_as_sfc(y, as_points=TRUE), pch=3, cex=.5, col = 'blue', add = TRUE)
  > plot(st_transform(st_as_sfc(x, as_points=FALSE), new), add = TRUE)
  > 
  > tif = system.file("tif/L7_ETMs.tif", package = "stars")
  > x = read_stars(tif)[,1:10,1:10,1:3]
  > x_ = st_transform(x, st_crs(4326))
  > x__ = st_transform_proj(x, st_crs(4326)$proj4string)
  > st_crs(x_) = st_crs(x__)
  > all.equal(x_,x__)
  [1] TRUE
  > 
  > # x__ = st_transform(x, x_) #now in st_warp 
  > # all.equal(x_, x__)
  > 
  > x = st_xy2sfc(x, as_points = FALSE)
  > (x_ = st_transform(x, st_crs(4326)))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median  Mean 3rd Qu. Max.
  L7_ETMs.tif    25      43     51 50.72      60   74
  dimension(s):
           from  to refsys point
  geometry    1 100 WGS 84 FALSE
  band        1   3     NA    NA
                                                                  values
  geometry POLYGON ((-34.91617 -7.94...,...,POLYGON ((-34.91385 -7.95...
  band                                                              NULL
  > (x__ = st_transform_proj(x, st_crs(4326)))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
               Min. 1st Qu. Median  Mean 3rd Qu. Max.
  L7_ETMs.tif    25      43     51 50.72      60   74
  dimension(s):
           from  to refsys point
  geometry    1 100 WGS 84 FALSE
  band        1   3     NA    NA
                                                                  values
  geometry POLYGON ((-34.91617 -7.94...,...,POLYGON ((-34.91385 -7.95...
  band                                                              NULL
  > all.equal(x_,x__,check.attributes = FALSE)
  [1] TRUE
  > 
  > # nothing to transform: now errs:
  > try(st_transform(st_as_stars(list(matrix(1,10,10))), st_crs(4326)))
  Error in st_transform.stars(st_as_stars(list(matrix(1, 10, 10))), st_crs(4326)) : 
    !is.na(st_crs(x)) is not TRUE
  > try(st_transform_proj(st_as_stars(list(matrix(1,10,10))), st_crs(4326)))
  Error in st_transform_proj.stars(st_as_stars(list(matrix(1, 10, 10))),  : 
    !is.na(st_crs(x)) is not TRUE
  > 
  > proc.time()
     user  system elapsed 
     1.34    0.35    1.68