setwd("D:/Research/code/rcode") #notice the "/"
list.files(getwd())
heisenberg <- read.csv(file="simple.csv",head=TRUE,sep=",")
colnames(datatemp)<-c("ID","InsertDate","F1","F2","F3","F4","AccountID","DeviceID","SearchKey") #change the header of the dataframe
简单介绍下R中的各种APPLY函数:
https://screamyao.wordpress.com/2011/05/03/various-apply-functions-in-r-explained/
table_temp_avg_date<-as.data.frame(temp_avg_date) # list to data frame
rm(*) # remove variable
agg_datatemp<-aggregate(datatemp[,3],list(datatemp$Date),mean) # group by column 3 and apply mean
data_stats_temp[grep("hotwaterhours", data_stats_temp$StatsType), ]