# 从人员 , 模块 , 时间三个维度考虑 BUG, 任务 , 特征数量 , 及其变化趋势 .
data <- read.csv("e:/jria.csv");
// 数据预处理
data$ASSIGNEE <- as.character(data$ASSIGNEE);
data$issuetype <- as.numeric(data$issuetype);
data$issuenum <- as.numeric(data$issuenum);
data$comname <- as.character(data$comname);
temp <-as.Date(as.character(data$RESOLUTIONDATE))
data$reso.year <- format(temp,format = "%Y")
data$reso.month <- format(temp,format = "%m")
data$reso.day <- format(temp,format = "%d")
temp <-as.Date(as.character(data$CREATED))
data$create.year <- format(temp,format = "%Y")
data$create.month <- format(temp,format = "%m")
data$create.day <- format(temp,format = "%d")
aggfun <- function(data,statcolname){
result.new <- aggregate(data$issueid,by = list("year" = data$create.year,"month" = data$create.month,"day"=data$create.day,statcolname=data[,statcolname]),length);
colnames(result.new)[5] <- paste(statcolname,"newnumber",sep = ".");
colnames(result.new)[4] <- statcolname;
result.new <- result.new[order( result.new$year, result.new$month, result.new$day,decreasing = FALSE),];
result.reso <- aggregate(data$issueid,by = list("year" = data$reso.year,"month" = data$reso.month,"day"=data$reso.day,statcolname=data[,statcolname]),length);
colnames(result.reso)[5] <- paste(statcolname,"resonumber",sep = ".");;
colnames(result.reso)[4] <- statcolname;
result.reso <- result.reso[order( result.reso$year, result.reso$month, result.reso$day,decreasing = FALSE),];
result <- merge(result.new,result.reso,by=c("year","month","day",statcolname),all = TRUE);
result[is.na(result[,5]),5] <- 0;
result[is.na(result[,6]),6] <- 0;
return(result);
}
Attachments:
JIRA数据处理(R).docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document)