Take a csquares object created with new_csquares or as_csquares and coerce it to a spatiotemporal array (stars).

st_as_stars.csquares(x, ...)

Arguments

x

An object of class csquares created with new_csquares or as_csquares

...

ignored.

Value

Returns a spatiotemporal array (stars) object based on x.

Author

Pepijn de Vries

Examples

library(stars)
#> Loading required package: abind
st_as_stars(as_csquares("7500:110:3|7500:110:1|1500:110:3|1500:110:1"))
#> stars object with 2 dimensions and 1 attribute
#> attribute(s):
#>   csquares         
#>  Length:4          
#>  Class :character  
#>  Mode  :character  
#> dimension(s):
#>   from to offset delta refsys x/y
#> x    1  2   -0.5   0.5 WGS 84 [x]
#> y    1  2     52  -0.5 WGS 84 [y]
st_as_stars(as_csquares(orca, csquares = "csquares"))
#> stars object with 2 dimensions and 2 attributes
#> attribute(s):
#>   csquares          orcinus_orca   
#>  Length:2592        Mode :logical  
#>  Class :character   FALSE:1849     
#>  Mode  :character   TRUE :209      
#>                     NA's :534      
#> dimension(s):
#>   from to offset delta refsys x/y
#> x    1 72   -180     5 WGS 84 [x]
#> y    1 36     90    -5 WGS 84 [y]