View source: R/revenue_standardization.R
| standardize_revenue_units | R Documentation |
Ensures revenue values have consistent units across all sensortowerR functions. The Sensor Tower API returns revenue in cents, but for consistency with other functions like st_sales_report, this converts to base currency units.
standardize_revenue_units(data, source = "unknown", target_unit = "base")
data |
Data frame containing revenue columns |
source |
Character string indicating the data source |
target_unit |
Character string: "base" (dollars/euros/etc) or "cents" |
The Sensor Tower API inconsistently returns revenue values: - Top Charts API: revenue in cents - Sales Report API: revenue in base currency units - Publishers API: revenue in cents (but converts to base units)
This function ensures consistency by converting all revenue to base units by default, while preserving the original values for reference.
Data frame with standardized revenue values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.