Description Usage Arguments Value Examples
Convert an observation-by-period data frame into a data frame of line segment coordinates, where each row represents a line segment connecting two time points from the original data.
1 | segmentize(data, na.span = FALSE, na.omit = TRUE)
|
data |
A data frame containing observation-by-period data, where the only columns represent sequentially ordered time period values for each observation. Some values can be missing. |
na.span |
A logical indicating whether line segments should span periods with missing values. The default is |
na.omit |
A logical indicating whether to drop missing observations from the resulting data frame |
A five-variable data frame containing: the row from the original data frame, and x1, x2, y1, y2 positions for each segment.
1 2 | data(gdp)
head(segmentize(gdp))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.