dplyr verbs for stars objects; package dplyr needs to be loaded before these methods can be used for stars objects.

filter.stars(.data, ...)

filter.stars_proxy(.data, ...)

mutate.stars(.data, ...)

mutate.stars_proxy(.data, ...)

transmute.stars(.data, ...)

transmute.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, ...)

replace_na.stars(data, replace, ...)

replace_na.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?

data

data set to work on

replace

see replace_na: list with variable=value pairs, where value is the replacement value for NA's

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): #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> L7_ETMs.tif 21 52 65 65.96675 78 255 #> dimension(s): #> from to offset delta refsys point values x/y #> x 1 349 288776 28.5 UTM Zone 25, Southern Hem... FALSE NULL [x] #> y 1 352 9120761 -28.5 UTM Zone 25, Southern Hem... 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): #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> L7_ETMs.tif 11 56 68 70.50099 82 252 #> dimension(s): #> from to offset delta refsys point values x/y #> x 50 100 288776 28.5 UTM Zone 25, Southern Hem... FALSE NULL [x] #> y 1 352 9120761 -28.5 UTM Zone 25, Southern Hem... FALSE NULL [y] #> band 1 6 NA NA NA NA NULL