Skip to content

Instantly share code, notes, and snippets.

@brdsio
Created April 13, 2021 19:20
Show Gist options
  • Save brdsio/7fc6f04c521db54beb4925bc43287144 to your computer and use it in GitHub Desktop.
Save brdsio/7fc6f04c521db54beb4925bc43287144 to your computer and use it in GitHub Desktop.
require(data.table)
library(openxlsx)
filename <- "EXP_COMPLETA.csv"
df <- fread(filename, header = T, sep=";")
country_id <- 160
df_country <- df[df$CO_PAIS == country_id]
df_country$QT_ESTAT <- as.numeric(df_country$QT_ESTAT)
df_country$KG_LIQUIDO <- as.numeric(df_country$KG_LIQUIDO)
write.xlsx(df_country, 'df_country.xlsx')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment