options(stringsAsFactors = F)
options(digits = 3)
rm(list = ls())
source("D:\\R\\packages\\Mreport\\scripts\\caculate.R", encoding = "utf-8")
source("D:\\R\\packages\\Mreport\\scripts\\select.R", encoding = "utf-8")
library(Mreport)
library(plyr)
library(dplyr)
load_base()
load_sample_base()
months <- 201806:201812
jdall <- list()
for(i in 1:length(months)){
  path <- paste(c("D:\\data\\sx_raw\\交调数据\\jd",months[i],".csv"),collapse = "")
  jdall[[i]] <- read.csv(path)
}
names(jdall) <- months
sapply(jdall, dim)
jdalls <- lapply(jdall, handle_gather)
l <- lapply(jdalls,`[[`,"index")
usefulstation <- Reduce(intersect,l)
length(usefulstation)
jdalls <- lapply(jdalls, function(x) filter(x,index %in% usefulstation))
sapply(jdalls, dim)
unique(jdalls$`201812`$roadlevel2)
ldply(jdalls, caculate_carsmean, attsname = "roadlevel2") %>% head()



ahorawzy/Mreport documentation built on May 3, 2019, 3:40 p.m.