# Return the percent migration of the number of credit facilities
migrate(
data = mock_credit,
id = customer_id,
time = date,
state = risk_rating
)
# Return the absolute migration in `principal_balance`
migrate(
data = mock_credit,
id = customer_id,
time = date,
state = risk_rating,
metric = principal_balance,
percent = FALSE
)
Run the code above in your browser using DataLab