R言語積算加算、時間列生成、つづり文字列、一括インポートエクスポート
1452 ワード
w<-read.table("E:/bs/sys/ ( 0)/nucmail.txt",sep="")
head(w)
w1<-rowSums(w[,c(2:236)])
w<-w$V1
length(w)
length(w1)
x=data.frame(w,w1)
write.table (x, file ="E:/bs/sys/nucmail.txt", sep =" ", row.names =F, col.names =F, quote =F)
rm(list=ls())
w<-read.table("E:/bs/sys/ ( 0)/wymail.txt",sep="")
head(w)
w1<-colSums(w[,c(2:236)])
write.table (w1, file ="E:/bs/sys/wymail.txt", sep =" ", row.names =F, col.names =F, quote =F)
d=seq(as.Date("2000/1/1"),as.Date("2000/1/5"), by="day") # XXXX.XX.XX XXXX.XX.XX
d[-c(1,2,3)]
length(d)
which(d == "2014-07-31")
d=d[-202]
d=seq(as.Date("2013/12/14"),as.Date("2014/8/5"), by="day")
x<-c("dban","kx","nucmail","qqmail","qzone","rr","sinamail","sinawb","tencentwb","wymail")
for (i in x){
data<-paste("E:/bs/sys/ ( 0)/",i,".txt",sep="")#
w<-read.table(data,sep="")
w1<-colSums(w[,c(2:236)])
#print(data)
data<-paste("E:/bs/sys/",i,".txt",sep="")
#print(data)
sc=data.frame(d,w1)
write.table (sc, file =data, sep =" ", row.names =F, col.names =F, quote =F)
}