options(stringsAsFactors = F) rm(list = ls()) source("D:\\R\\packages\\Mreport\\scripts\\source_toglobal.R", encoding = "utf-8")
library(Mreport) library(plyr) library(ggplot2) library(reshape2) library(knitr)
load_base() load_sample_base()
jdgd <- read.csv("D:\\data\\sx_raw\\交调数据\\jd2018_06_GuangDong.csv") dim(jdgd)
jdgd <- split_day(jdgd) jdgd <- caculate_equivalent(jdgd) jdgd <- select_atts_forday(jdgd) jdgd <- handle_mergeline(jdgd,station_line) jdgd <- handle_mergesample(jdgd,sample_base) jdgd <- merge(jdgd,roadlevel,by="index",all.x = T) jdgd <- subset(jdgd,index %in% station_use)
(gd <- ddply(jdgd,"day",summarise,Wmean = weighted.mean(cars,w=mileage))) %>% kable()
gg_boxplot(gd,xlabname = "日期",ylabname = "每日机动车当量") ggsave(file="D:\\交大云同步\\实习\\06_月度分析报告\\6月分析\\绘图\\广东6月.png",dpi=600)
6月8日广东暴雨,交通量下降明显。
jdgd08 <- subset(jdgd,day=="08") jdgd01 <- subset(jdgd,day=="01")
gd08 <- caculate_carsmean(jdgd08,"city")
gd01 <- caculate_carsmean(jdgd01,"city") x1 <- caculate_increaseratio(gd08,gd01)
merge(gd08,x1,by="city") %>% kable()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.