get_switching_regime_dataframe | R Documentation |
The function augement a dataset with three more columns, ymin, ymax and regime, where ymin and ymax are pmin and pmax of y and y2, regime tells y>=y2 or y<=y2 happens. In addition, interpolated x observations are inserted to prevent void area in geom_ribbon usage when x is discreate
get_switching_regime_dataframe(.df, targetColumns)
.df |
a data frame to select x, y and y2 from, where x must have "POSIXct" "POSIXt" class, y and y2 are numeric |
targetColumns |
a named character as c("x"="x in .df", "y"="y in .df", "y2"="y2 in .df") where "zzz in .df" means column name in .df that represents zzz vector for switching regime dataset construction. |
targetColumns = c("x"="year1",
"y"="商品及服務輸出佔比", "y2"="商品及服務輸入佔比")
get_switching_regime_dataframe(.df, targetColumns)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.