Upload files to "/"
This commit is contained in:
parent
f806bdd2c0
commit
9829ac12bc
@ -1266,6 +1266,7 @@ dbListTables(mydb)
|
||||
#仪器编号和序列号<-read.csv("仪器编号和序列号.csv",encoding = "UTF-8",fill = TRUE)
|
||||
rs = dbSendQuery(mydb, "select * from 和迈.仪器编号和序列号1m ")
|
||||
仪器编号和序列号 = fetch(rs, n=-1)
|
||||
仪器编号和序列号<-仪器编号和序列号[!duplicated(仪器编号和序列号[,c("仪器编号","仪器序列号" )]),]
|
||||
colnames(仪器编号和序列号)
|
||||
#仪器编号和序列号<-distinct(仪器编号和序列号[,2:22])
|
||||
#仪器编号和序列号<-read.csv("仪器编号和序列号.csv",encoding = "UTF-8",fill = TRUE)
|
||||
@ -1290,11 +1291,33 @@ df2<-df2[!is.na(df2$批次名称),]
|
||||
df2andInf<-merge(df2,仪器编号和序列号[,c("仪器编号","仪器序列号","发货时间" ,"申请日期" ,
|
||||
"小细胞" , "客户编码" , "代理商名称" ,
|
||||
"用户名称" , "规格" , "状态")],by="仪器序列号",all.x=TRUE,all.y=FALSE)
|
||||
|
||||
df2andInf$省编号<-(df2andInf$省市编号 %/% 10000)*10000
|
||||
df2andInf$省名<-str_sub(df2andInf$详细地址,1,3)
|
||||
df2andInf$省名[str_length(df2andInf$省名)<3]<-NA
|
||||
|
||||
df2andInf$省名[str_like(df2andInf$省编号,paste(paste("%","120000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"天津市"
|
||||
df2andInf$省名[str_like(df2andInf$省编号,paste(paste("%","230000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"黑龙江"
|
||||
df2andInf$省名[str_like(df2andInf$省编号,paste(paste("%","320000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"江苏省"
|
||||
df2andInf$省名[str_like(df2andInf$省编号,paste(paste("%","420000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"湖北省"
|
||||
df2andInf$省名[str_like(df2andInf$省编号,paste(paste("%","510000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"四川省"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","重庆市",sep=""),"%",sep=""), ignore_case = TRUE)]<-"500000"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","广西壮",sep=""),"%",sep=""), ignore_case = TRUE)]<-"450000"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","江西省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"360000"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","北京市",sep=""),"%",sep=""), ignore_case = TRUE)]<-"110000"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","河北省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"130000"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","上海市",sep=""),"%",sep=""), ignore_case = TRUE)]<-"310000"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","浙江省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"330000"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","四川省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"510000"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","安徽省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"340000"
|
||||
df2andInf$省编号[str_like(df2andInf$省名,paste(paste("%","贵州省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"520000"
|
||||
|
||||
df2andInf<-distinct(df2andInf)
|
||||
|
||||
#df2andInf0<-df2andInf[str_c(df2andInf$仪器编号, df2andInf$仪器序列号)!=NA,]
|
||||
|
||||
|
||||
|
||||
df2andInf$是否阳性<-df2andInf$结论
|
||||
df2andInf$是否阳性[df2andInf$是否阳性=="阳性"]<-1.0
|
||||
df2andInf$是否阳性[df2andInf$是否阳性=="阴性"]<-0.0
|
||||
@ -1308,9 +1331,6 @@ df2andInf$结论<-as.numeric(df2andInf$结论)
|
||||
|
||||
df2andInf$是否有效<-1
|
||||
df2andInf$是否有效[df2andInf$是否阳性==0.5]<-0
|
||||
df2andInf$省编号<-(df2andInf$省市编号 %/% 10000)*10000
|
||||
df2andInf$省名<-str_sub(df2andInf$详细地址,1,3)
|
||||
df2andInf$省名[str_length(df2andInf$省名)<3]<-NA
|
||||
|
||||
Numberof项目号<-length(unique(df2andInf$项目号))
|
||||
Numberof批次号<-length(unique(df2andInf$批次号))
|
||||
@ -1328,9 +1348,28 @@ Numberof仪器投放区域<-length(unique(df2andInf$仪器投放区域))
|
||||
Numberof样本类型<-length(unique(df2andInf$样本类型))
|
||||
|
||||
|
||||
|
||||
省编号and省名<-cbind(df2andInf$省编号,df2andInf$省名)
|
||||
if(FALSE){
|
||||
省编号and省名<-data.frame(cbind(df2andInf$省编号,df2andInf$省名))
|
||||
colnames(省编号and省名)<-c("省编号","省名")
|
||||
省编号and省名<-省编号and省名[!duplicated(省编号and省名),]
|
||||
省编号and省名<-省编号and省名[order(省编号and省名$省编号),]
|
||||
省编号and省名$省名[str_like(省编号and省名$省编号,paste(paste("%","120000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"天津市"
|
||||
省编号and省名$省名[str_like(省编号and省名$省编号,paste(paste("%","230000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"黑龙江"
|
||||
省编号and省名$省名[str_like(省编号and省名$省编号,paste(paste("%","320000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"江苏省"
|
||||
省编号and省名$省名[str_like(省编号and省名$省编号,paste(paste("%","420000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"湖北省"
|
||||
省编号and省名$省名[str_like(省编号and省名$省编号,paste(paste("%","510000",sep=""),"%",sep=""), ignore_case = TRUE)]<-"四川省"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","重庆市",sep=""),"%",sep=""), ignore_case = TRUE)]<-"500000"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","广西壮",sep=""),"%",sep=""), ignore_case = TRUE)]<-"450000"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","江西省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"360000"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","北京市",sep=""),"%",sep=""), ignore_case = TRUE)]<-"110000"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","河北省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"130000"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","上海市",sep=""),"%",sep=""), ignore_case = TRUE)]<-"310000"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","浙江省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"330000"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","四川省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"510000"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","安徽省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"340000"
|
||||
省编号and省名$省编号[str_like(省编号and省名$省名,paste(paste("%","贵州省",sep=""),"%",sep=""), ignore_case = TRUE)]<-"520000"
|
||||
省编号and省名<-省编号and省名[!duplicated(省编号and省名),]
|
||||
}
|
||||
|
||||
summaryTable<-stri_join("Numberof测试: ",as.character(nrow(df2andInf)),
|
||||
"\nNumberof项目名称: ", as.character(Numberof项目名称),
|
||||
@ -1783,7 +1822,7 @@ dfByMonthAnd细胞$测试数<-as.integer(dfByMonthAnd细胞$测试数)
|
||||
dfByMonthAnd细胞$有效数<-as.integer(dfByMonthAnd细胞$有效数)
|
||||
dfByMonthAnd细胞 <- dfByMonthAnd细胞[order(dfByMonthAnd细胞$testMonth),]
|
||||
|
||||
cairo_pdf(paste("和迈dataAnalytics07142025n",".pdf",sep=""), width = 8, height = 6,family = "SimHei" )
|
||||
cairo_pdf(paste("和迈dataAnalytics07142025a",".pdf",sep=""), width = 8, height = 6,family = "SimHei" )
|
||||
|
||||
plotSummaryTable<-ggplot() +geom_text(aes(x = 100, y = 40,
|
||||
label = summaryTable),
|
||||
@ -1816,9 +1855,9 @@ panelPlotByDayAndLocation(dfData=dfByDayAndLocation1,choosenList=dfBy区域$省
|
||||
dependentVariableNames=c("测试数","有效数","阳性数"),titleNames=c("最后六周按日测试统计","测试时间","统计数值",""))
|
||||
panelPlotByDayAndLocation(dfData=dfByDayAndLocation1,choosenList=dfBy区域$省编号[13:18],independentVariableName="testDay",panelName="省编号",
|
||||
dependentVariableNames=c("测试数","有效数","阳性数"),titleNames=c("最后六周按日测试统计","测试时间","统计数值",""))
|
||||
panelPlotByDayAndLocation(dfData=dfByDayAndLocation1,choosenList=dfBy区域$省编号[c(19:23,25)],independentVariableName="testDay",panelName="省编号",
|
||||
panelPlotByDayAndLocation(dfData=dfByDayAndLocation1,choosenList=dfBy区域$省编号[c(19:24)],independentVariableName="testDay",panelName="省编号",
|
||||
dependentVariableNames=c("测试数","有效数","阳性数"),titleNames=c("最后六周按日测试统计","测试时间","统计数值",""))
|
||||
panelPlotByDayAndLocation(dfData=dfByDayAndLocation1,choosenList=dfBy区域$省编号[26:31],independentVariableName="testDay",panelName="省编号",
|
||||
panelPlotByDayAndLocation(dfData=dfByDayAndLocation1,choosenList=dfBy区域$省编号[c(25,27:31)],independentVariableName="testDay",panelName="省编号",
|
||||
dependentVariableNames=c("测试数","有效数","阳性数"),titleNames=c("最后六周按日测试统计","测试时间","统计数值",""))
|
||||
|
||||
panelPlotByDayAndLocation(dfData=dfByDayAndLocation1,choosenList=dfBy区域$省编号[1:6],independentVariableName="testDay",panelName="省编号",
|
||||
@ -1871,9 +1910,9 @@ panelPlotByMonthAndLocation(dfData=dfByMonthAndLocation,choosenList=dfBy区域$
|
||||
dependentVariableNames=c("测试数","有效数","阳性数"),titleNames=c("按月分省测试统计","测试时间","统计数值",""))
|
||||
panelPlotByMonthAndLocation(dfData=dfByMonthAndLocation,choosenList=dfBy区域$省编号[13:18],independentVariableName="testMonth",panelName="省编号",
|
||||
dependentVariableNames=c("测试数","有效数","阳性数"),titleNames=c("按月分省测试统计","测试时间","统计数值",""))
|
||||
panelPlotByMonthAndLocation(dfData=dfByMonthAndLocation,choosenList=dfBy区域$省编号[c(19:23,25)],independentVariableName="testMonth",panelName="省编号",
|
||||
panelPlotByMonthAndLocation(dfData=dfByMonthAndLocation,choosenList=dfBy区域$省编号[c(19:24)],independentVariableName="testMonth",panelName="省编号",
|
||||
dependentVariableNames=c("测试数","有效数","阳性数"),titleNames=c("按月分省测试统计","测试时间","统计数值",""))
|
||||
panelPlotByMonthAndLocation(dfData=dfByMonthAndLocation,choosenList=dfBy区域$省编号[26:31],independentVariableName="testMonth",panelName="省编号",
|
||||
panelPlotByMonthAndLocation(dfData=dfByMonthAndLocation,choosenList=dfBy区域$省编号[c(25,27:31)],independentVariableName="testMonth",panelName="省编号",
|
||||
dependentVariableNames=c("测试数","有效数","阳性数"),titleNames=c("按月分省测试统计","测试时间","统计数值",""))
|
||||
|
||||
panelPlotByMonthAndLocation(dfData=dfByMonthAndLocation,choosenList=dfBy区域$省编号[1:6],independentVariableName="testMonth",panelName="省编号",
|
||||
@ -1956,35 +1995,6 @@ dfBy仪器$仪器序列号<-factor(dfBy仪器$仪器序列号,levels = 仪器号
|
||||
dependentVariableNames=c("测试开始","测试截止"),titleNames=c("按仪器测试统计","仪器序列号","多少天之前",""))
|
||||
|
||||
|
||||
if(FALSE) {
|
||||
dfBy仪器00 <- df2000 %>% group_by(仪器序列号,省市编号,详细地址,仪器备注名称,仪器投放区域) %>% summarise(
|
||||
批次数=length(unique(批次名称)),
|
||||
测试数 = n(),
|
||||
样本数=length(unique(样本类型)),
|
||||
项目数=length(unique(项目名称)),
|
||||
阳性数=sum(结论,na.rm = TRUE),
|
||||
有效数=sum(是否有效,na.rm = TRUE),
|
||||
earliestIndex=min(IDIndex),
|
||||
medianIndex=median(IDIndex),
|
||||
latestIndex=max(IDIndex),
|
||||
最早测试=min(testDay,na.rm = TRUE),
|
||||
最近测试=max(testDay,na.rm = TRUE),
|
||||
测试开始 = round(max(testTimeFromeToday,na.rm = TRUE),2),
|
||||
测试截止 = round(min(testTimeFromeToday,na.rm = TRUE),2)
|
||||
)
|
||||
dfBy仪器00$阳性率<-dfBy仪器00$阳性数/dfBy仪器00$有效数
|
||||
dfBy仪器00$有效率<-dfBy仪器00$有效数/dfBy仪器00$测试数
|
||||
dfBy仪器00$阳性数<-as.integer(dfBy仪器00$阳性数)
|
||||
dfBy仪器00$测试数<-as.integer(dfBy仪器00$测试数)
|
||||
dfBy仪器00$有效数<-as.integer(dfBy仪器00$有效数)
|
||||
|
||||
|
||||
|
||||
dfBy仪器1<-merge(dfBy仪器00[,1:5],dfBy仪器,by="仪器序列号",all=FALSE)
|
||||
write_excel_csv(dfBy仪器1,file="仪器统计1.csv")
|
||||
#仪器号MissedFromTwoYearsAgo<-仪器号[!(仪器号 %in% 仪器号00)]
|
||||
}
|
||||
|
||||
#样本号List<-unique(dfBy样本$样本类型)
|
||||
plotfunction(dfData=dfBy样本,independentVariableName="样本类型",
|
||||
dependentVariableNames=c("测试数","有效数","阳性数"),titleNames=c("按样本类型测试统计","样本类型","统计数值",""))
|
||||
@ -2043,7 +2053,7 @@ colnames(df20)
|
||||
|
||||
# for(i in 1:5){
|
||||
|
||||
cairo_pdf(paste("和迈dataAnalyticsForRandD","_a07142025m.pdf",sep=""), width = 8, height = 6,family = "SimHei" )
|
||||
cairo_pdf(paste("和迈dataAnalyticsForRandD","_a07142025a.pdf",sep=""), width = 8, height = 6,family = "SimHei" )
|
||||
|
||||
plotSummaryTable
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user