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: 258 × 3
#>    date       cellvalue n_cells
#>    <date>         <int>   <int>
#>  1 2020-01-15        12      35
#>  2 2020-01-15        14     548
#>  3 2020-01-15        21      17
#>  4 2020-01-15        NA    1368
#>  5 2020-02-15        14     537
#>  6 2020-02-15        19       3
#>  7 2020-02-15        21      60
#>  8 2020-02-15        NA    1368
#>  9 2020-03-15        12       6
#> 10 2020-03-15        14     488
#> # ℹ 248 more rows