dplyr verbs for stars objects

filter.stars(.data, ...)

filter.stars_proxy(.data, ...)

mutate.stars(.data, ...)

mutate.stars_proxy(.data, ...)

select.stars(.data, ...)

select.stars_proxy(.data, ...)

pull.stars(.data, var = -1)

pull.stars_proxy(.data, ...)

as.tbl_cube.stars(x, ...)

slice.stars(.data, along, index, ..., drop = length(index) == 1)

slice.stars_proxy(.data, ...)

Arguments

.data

object of class stars

...

see filter

var

see pull

x

object of class stars

along

name or index of dimension to which the slice should be applied

index

integer value(s) for this index

drop

logical; drop dimensions that only have a single index?

Examples

tif = system.file("tif/L7_ETMs.tif", package = "stars") x1 = read_stars(tif) library(dplyr)
#> #> 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
x1 %>% slice("band", 2:3)
#> stars object with 3 dimensions and 1 attribute #> attribute(s): #> L7_ETMs.tif #> Min. : 21.00 #> 1st Qu.: 52.00 #> Median : 65.00 #> Mean : 65.97 #> 3rd Qu.: 78.00 #> Max. :255.00 #> dimension(s): #> from to offset delta refsys point values #> x 1 349 288776 28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [x] #> y 1 352 9120761 -28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [y] #> band 2 3 NA NA NA NA NULL
x1 %>% slice("x", 50:100)
#> stars object with 3 dimensions and 1 attribute #> attribute(s): #> L7_ETMs.tif #> Min. : 11.0 #> 1st Qu.: 56.0 #> Median : 68.0 #> Mean : 70.5 #> 3rd Qu.: 82.0 #> Max. :252.0 #> dimension(s): #> from to offset delta refsys point values #> x 50 100 288776 28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [x] #> y 1 352 9120761 -28.5 PROJCS["UTM Zone 25, Sout... FALSE NULL [y] #> band 1 6 NA NA NA NA NULL