2014年3月9日

R学习笔记之五:数据操作

摘要: 一、索引1、vector2、matrix和data.frame对于data.frame,使用attach(x),可以使数据框中的列项,可以像一般向量那样使用;再次直接使用detach(),即可解除3、array4、list二、查看1、字符串相关2、数值相关显示小数点:option(digits=),digits默认7,可选1~22。查看前几行:head(x)查看后几行:tail(x)查看随机:car::some(x),car包中的some函数,不知为何必须car::some形式调用。三、拆分、合并1、向量:c(x,y)矩阵:cbind(x,y)、rbind(x,y)2、四、二、排序、查重三、运 阅读全文

posted @ 2014-03-09 20:50 ahahaha 阅读(166) 评论(0) 推荐(0)

R学习笔记之四:数据获取及保存

摘要: 一、数据console读写:c(),scan(),edit(x),fix(x),data.entry(x)二、数据file读写:1、cat and scancat(x,file="x.txt",sep=","):file属性不为null时,保存到getwd()下面scan("x.txt",sep=","):file属性不为null时,从文件读入2、save and loadsave(x,file="x.Rdata"):load("x.Rdata"):3、read.table( 阅读全文

posted @ 2014-03-09 19:56 ahahaha 阅读(220) 评论(0) 推荐(0)

导航