Skip to contents

Find 'island rows' in a dataset with ordered rows. Islands have a series variable that is not `NA` surrounded by `NA` values in that same variable. This function could work well with pad_weeks, if you are looking for weekly 'islands'.

Usage

time_series_islands(data, series_variable, time_variable = NULL)

Arguments

data

A dataset (must be ordered if `time_variable` is `NULL`).

series_variable

Name of a series variable.

time_variable

Optional variable to use for ordering the dataset before islands are located.