| ntl_index | R Documentation |
Converts each group's values to an index where its baseline observation is 100. This is useful for comparing changes between sources with different units, but does not make their absolute levels comparable.
ntl_index(
panel,
baseline,
group_cols = NULL,
time_col = "year",
value_col = "mean_radiance",
index_col = "ntl_index"
)
panel |
Data frame containing nighttime-light observations. |
baseline |
Baseline value in |
group_cols |
Grouping columns. If omitted, uses |
time_col |
Time column name. Defaults to |
value_col |
Value column name. Defaults to |
index_col |
Name for the new index column. |
panel with an additional numeric index column.
panel <- data.frame(
region_id = rep(c("a", "b"), each = 3),
year = rep(2020:2022, 2),
mean_radiance = c(10, 12, 15, 4, 4, 5)
)
ntl_index(panel, baseline = 2020)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.