Summarize Seascape grids into a table having columns: date, cellvalue (ie CLASS) and number of cells (n_cells).

sum_ss_grds_to_ts(grds, ts_csv = NULL, verbose = F)

Arguments

grds

raster stack with more than one date, as returned by get_ss_grds

ts_csv

path to csv to save this time series table. Default is NULL, in which case the table is not saved. If path is set and already exists then that will be read in if all dates in the grds are present instead of recalculating and writing to ts_csv.

verbose

show messages of process. Useful for debugging. Default: FALSE.

Value

tibble of data

Details

This function is particularly helpful in between using get_ss_grds() and plot_ss_ts().

Examples

ply  <- get_url_ply("mbnms")
ss_i <- get_ss_info()
grds <- get_ss_grds(ss_i, ply, date_beg = "2020-01-01")
tbl  <- sum_ss_grds_to_ts(grds)
tbl
#> # A tibble: 192 × 3
#>    date       cellvalue n_cells
#>    <date>         <int>   <int>
#>  1 2020-01-15         7       2
#>  2 2020-01-15        12      31
#>  3 2020-01-15        14     565
#>  4 2020-01-15        21       2
#>  5 2020-01-15        NA    1368
#>  6 2020-02-15        14     547
#>  7 2020-02-15        19      11
#>  8 2020-02-15        21      44
#>  9 2020-02-15        NA    1366
#> 10 2020-03-15         7       3
#> # … with 182 more rows