r语言盒状图如何添加轴名称

Python012

r语言盒状图如何添加轴名称,第1张

利用ggplot2包,盒形图的轴有指标名称:

library(ggplot2)

p <- qplot(cut, depth, data=diamonds) + geom_boxplot()

p

1. paste 函数

paste(v1,v2,sep="")

拼接对象是向量

2. rbind(df1,df2) 行合并

cbind(df1,df2) 列合并

3. merge 按共有变量进行合并(匹配)

merge(x,y,by=intersect(names(x),names(y)),by.x=by, by.y=y, all =FALSE, all.x=FALSE,all.y=FALSE,...)

udf_async_rbind <- function(path= "D:/R/oper_key_index/data/d_data/",

name= "移网线上单" ,

Date_temp = format(Date_stemp,"%Y%m%d"), # 直接引用变量不执行,需加函数转为常量

Date_last_month_day = ymd("2021-08-31") , # 函数内变量名不要与外部变量名重复

Date_last_month_day1= ymd("2021-07-31") ,

cols=190 ){

x <- udf_DT(paste0(path,name,Date_temp,".xlsx") , 1 ,0)

y <- udf_DT(paste0(path,name,format(Date_last_month_day,"%Y%m%d"),".xlsx"),1,0)

z <- udf_DT(paste0(path,name,format(Date_last_month_day1,"%Y%m%d"),".xlsx"),1,0)

if(ncol(x)>70){

x <- x[,1:cols]

y <- y[,1:cols]

z <- z[,1:cols]}else{print("全列导入")}

setnames(y,names(x))

table <- rbind(x, y)

return(table)

}

mob_dev_2ilist <- udf_async_rbind( name = "移网线上单" )