Created
February 4, 2016 16:40
-
-
Save primaryobjects/ca1287a7bf5d1ee48c0e to your computer and use it in GitHub Desktop.
Reading exported monthly xlsx files. List of .csv.xlsx files would exist in /data folder, named in the form January.csv.xlsx, February.csv.xlsx, etc.
This file contains hidden or 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
## Including the required R packages. | |
packages <- c('openxlsx') | |
if (length(setdiff(packages, rownames(installed.packages()))) > 0) { | |
install.packages(setdiff(packages, rownames(installed.packages()))) | |
} | |
library(openxlsx) | |
data <- data.frame() | |
x <- sapply(month.name, function(month) { | |
data <<- rbind(data, read.xlsx(paste0('data/', month, '.csv.xlsx'))) | |
}) | |
data <- data[!is.na(data$Status),] | |
data$Fee <- as.numeric(data$Fee) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment