## code to prepare `terms_mix_monsanto_brasil` dataset goes here
X405_TM_MON <- readxl::read_excel("T:/Financeiro/Private/C&C/digital_analytics/terms_mix/brazil_nflist/405_TM_MON.xlsx")
X405_TM_MON <- X405_TM_MON %>%
janitor::clean_names()
terms_mix_monsanto_brasil <- X405_TM_MON %>%
transmute(
cliente = matriz,
nome_grupo_agregado_monsanto_bayer = nome_da_matriz,
setor_atividade = setor_atividade,
negocio = negocio,
marca = marca,
safra = safra,
uneg = u_neg,
reg = reg,
consultor = especialista,
anomes = ano_mes_real,
data_de_vencimento = data_vencto_ajustada,
aging = aging,
cond_pgto = cond_pagto,
terms_mix = cond_pagto_descricao,
modalidade = modalidade,
valor_brl = preco_aproxim_venda,
legacy = "Monsanto"
) %>%
mutate(terms_mix = case_when(
terms_mix == "Available Grain" ~ "Cash",
terms_mix == "Barter" ~ "Barter",
terms_mix == "Cash" ~ "Cash",
terms_mix == "CRA" ~ "CRA",
terms_mix == "Less than 30" ~ "Short-Term",
terms_mix == "Risk Sharing" ~ "Risk Sharing",
terms_mix == "Rural Credit" ~ "Rural Credit",
terms_mix == "Terms" ~ "Traditional",
terms_mix == "Vendor" ~ "Traditional"
)) %>%
mutate_at(vars(cliente, anomes), as.character) %>%
filter(str_extract(anomes, pattern = "[:digit:]{4}") >= 2019) # year >= 2019
terms_mix_monsanto_brasil %>%
bind_rows(terms_mix_bayer_brasil) %>%
View()
usethis::use_data(terms_mix_monsanto_brasil, overwrite = TRUE, compress = "xz")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.