R command

R语言APPLY函数详解
本文介绍了R语言中APPLY系列函数的应用方法,并通过实例展示了如何使用这些函数进行数据处理和统计分析。此外,还提供了读取CSV文件、设置工作目录、数据框操作等实用技巧。

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), ]

 

posted on 2016-01-12 16:18 攻城狮科学家 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/dataclimber/p/5124733.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值