setwd("C:/Users/ARC/Desktop") #setwd():设定当前工作目录
df1=read.csv("yisuo.csv",skip=1) #skip:读取数据前跳过的行的数目
time1=df1[,2] #
hour=as.numeric(lapply(time1,function(x)substr(x,7,8))) #as.numeric():转换为数值型
day=as.numeric(lapply(time1,function(x)substr(x,4,5)))
month=as.numeric(lapply(time1,function(x)substr(x,1,2)))
mean1=tapply(df1[,8],list(month,day),function(x)mean(x,na.rm=T))
month=substr(time1[1],4,5)
day=substr(time1[1],1,2)
colnames(df1)
plot(df1[,9],type="l")
mean(df1[,9],na.rm=T)
which(is.na(df1[,9])) #is.na():检测缺失值是否存在,返回为true和false