View source: R/BrandDensity2.R
Function outputs netcoord with density and density ranges that can be used to produce consisted densities year over year
1 2 3 | valueByNet2Density2(df, value_col, resolution = 10, df_ranges = NULL,
dens_ranges = NULL, h = 2, n = 50, tracker = "Some Brand",
PY = 1)
|
df |
dataframe with net coord and some value, 2 columns |
value_col |
value, most likely transactions summed by net_coord |
resolution |
how many categories for density will be created. default=10 |
df_ranges |
character vector that is simialar to the output of *cut* function. Each element represents a range closed on the right. NULL for current season, adjustment for PY |
dens_ranges |
character vector that is simialar to the output of *cut* function. Each element represents a range closed on the right. NULL for current season, adjustment for PY |
h |
comes from MASS::kde2d. kernel parameters. See MASS::kde2d for details |
n |
comes from MASS::kde2d. size of the grid.See MASS::kde2d for details |
tracker |
an optional string that can be supplied to be added to df_ranges and dens_ranges |
PY |
an adjustment factor. use 1 for CY, adjust to decline CY/PY for PY |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.