Created
September 23, 2020 07:36
-
-
Save ktaranov/ea78cbf704a8cd34b07abb70756e18d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Пакет работы с Excel файлами | |
library("openxlsx") | |
library("logging") | |
library("RODBC") | |
suppressPackageStartupMessages(library("data.table")) | |
loggerName <- "ge_dcast" | |
file_name <- "GE обр НТ_v06.xlsx" | |
loginfo(msg = "0 Start", logger = loggerName) | |
dt1 <- read.xlsx(xlsxFile = file_name, | |
sheet = 1, | |
colNames = TRUE, | |
detectDates = FALSE, | |
skipEmptyRows = FALSE | |
) | |
dt2 <- read.xlsx(xlsxFile = file_name, | |
sheet = 2, | |
colNames = TRUE, | |
detectDates = FALSE, | |
skipEmptyRows = FALSE | |
) | |
dt <- rbind(dt1, dt2) | |
rm(dt1, dt2) | |
setnames(dt, names(dt), as.character(c(1:length(dt)))) | |
# dtCast <- dcast( | |
# data = dt, | |
# ExportCountry ~ YearMonth, | |
# fun = sum, | |
# value.var = c("Export", "Import") | |
# ) | |
loginfo(msg = "End", logger = loggerName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment