Description Usage Arguments Details Value Examples
View source: R/transform_customers.R
Adds customer history to the customers data by joining the 4 data sets. Cleans some variables and also makes some new ones.
1 | transform_customers(customers, customers_styles, address, income)
|
customers |
Data frame, from the customers.rds file |
income |
Data frame, from the median_income_by_zipcode.csv file |
customer_styles |
Data frame, from the customers_styles.rds file |
addresses |
Data frame, from the addresses.rds file |
Modifies/ Cleans:
Modifies the top_quality & jewelry_quality
columns in
the customers data
Cleans the style and the address
Also cleans shipping_period & changed_periods
Adds:
No_sh_periods
, number of changed shipment periods
age
, fixes the birthdate
age_group
, groups them into categories
Returns the customers data (a data frame) with the aforementioned modifications.
1 2 3 4 5 6 | customers = readRDS('Data/Main_data/customers.rds')
customer_styles <- readRDS('Data/Main_data/customer_styles.rds')
addresses <- readRDS('Data/Main_data/addresses.rds')
income <- read.csv('Data/Auxiliary_data/median_income_by_zipcode.csv')
transformed_customers_data <- transform_customers(customers, customer_styles,
addresses, income)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.