standardize_revenue_units: Standardize Revenue Units Across sensortowerR

View source: R/revenue_standardization.R

standardize_revenue_unitsR Documentation

Standardize Revenue Units Across sensortowerR

Description

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.

Usage

standardize_revenue_units(data, source = "unknown", target_unit = "base")

Arguments

data

Data frame containing revenue columns

source

Character string indicating the data source

target_unit

Character string: "base" (dollars/euros/etc) or "cents"

Details

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.

Value

Data frame with standardized revenue values


sensortowerR documentation built on March 18, 2026, 5:07 p.m.