当前位置: 首页 > news >正文

做网站的基本条件老鬼seo

做网站的基本条件,老鬼seo,重庆外贸网站建设,青岛贸易公司 网站制作数据预处理 R语言处理的数据多以数据框的形式出现。 预备操作 数据查看 > dim(x) [1] 16 3 #数据框有16行3列 > names(x) #查看数据框的变量名 [1] "X" "Z" "Y" > head(x,3) #查看前3行,若为-3则是查看后三行之…

数据预处理

R语言处理的数据多以数据框的形式出现。

预备操作

  1. 数据查看
> dim(x)
[1] 16  3     #数据框有16行3列
> names(x)     #查看数据框的变量名
[1] "X" "Z" "Y"
> head(x,3)     #查看前3行,若为-3则是查看后三行之外的数据X    Z    Y
1 140.1 37.0 2.25
2 151.5 38.5 3.00
3 161.2 42.1 3.25
> tail(x,3)      #查看后3行,若为-3则是查看前3行之外的数据X    Z    Y
14 149.5 39.7 2.75
15 159.6 44.5 3.00
16 162.5 45.0 3.20

读取数据后可用attach载入数据框,即attach(x),由此可直接用列名,而不需再用$引用

  1. 数据筛选
Which( )函数
> a=c(2,3,4,2,5,1,6,3,2,5,8,5,7,3)   
> which.max(a)      #表示a序列中第几个是最大
[1] 11
> which.min(a)
[1] 6
> a[which.max(a)]      #先算里面的函数
[1] 8
> which(a==2)      #求哪些元素等于2
[1] 1 4 9
> a[which(a==2)]
[1] 2 2 2
> which(a>5)
[1]  7 11 13
> a[which(a>5)]
[1] 6 8 7
x<-read.table("li14.3.txt",header=T)
x$gender[which(x$gender=="f")]="女"
> y <- c(7,7,15,11,9,12,17,12,18,18,14,18,18,
+        19,19,19,25,22,19,23,7,10,11,15,11)
> n <- factor(rep(c("15%","20%","25%","30%","35%"),each=5))
> d <- data.frame(y,n)
> which(d[,2]=="15%")     #求出第多少行满足条件
[1] 1 2 3 4 5
> mean(d[which(d[,2]=="15%"),1])      # 对数据框1-5行第1列求均值
[1] 9.8                              

修改变量名

> names(x)
[1] "X" "Z" "Y"
> names(x)<-paste("x",1:3,sep="")      #由此变量名全部修改
> names(x)
[1] "x1" "x2" "x3"
> names(x)[3]<-"产量"        #把第3列的变量名修改为"成绩"
> names(x)
[1] "x1"     "x2"     "成绩"

删除变量

给该变量赋予空值NULL即可,(指从数据集中删除)

ug$GPA<-NULL

排序

> x[order(x$成绩),]         #按成绩升序排列(默认)x1   x2 成绩
1  140.1 37.0 2.25
8  157.0 37.0 2.25
> x[order(x$成绩,decreasing=T),]      #按成绩降序排列x1   x2 成绩
7  170.5 54.5 3.50
3  161.2 42.1 3.25

缺失值处理

  1. 缺失值识别
> x$x2[3]<-NA
> is.na(head(x$x2,3))
[1] FALSE FALSE  TRUE
  1. 缺失值排除
> x_NA<-na.omit(x)     #把缺失值所在行排除
> x_NAx1   x2 成绩
1  140.1 37.0 2.25
2  151.5 38.5 3.00
4  172.8 46.5 3.25


文章转载自:
http://brought.stph.cn
http://psychologist.stph.cn
http://syncretist.stph.cn
http://invisibility.stph.cn
http://aerospace.stph.cn
http://hygienics.stph.cn
http://lumbricalis.stph.cn
http://indite.stph.cn
http://analeptic.stph.cn
http://garron.stph.cn
http://buckish.stph.cn
http://phyllotactical.stph.cn
http://consumerization.stph.cn
http://dsc.stph.cn
http://larchen.stph.cn
http://capitulaitonist.stph.cn
http://looseness.stph.cn
http://supererogatory.stph.cn
http://intolerance.stph.cn
http://carpolite.stph.cn
http://tapsalteerie.stph.cn
http://undisputable.stph.cn
http://nonentity.stph.cn
http://avast.stph.cn
http://triable.stph.cn
http://garniture.stph.cn
http://acne.stph.cn
http://bangle.stph.cn
http://hallstadt.stph.cn
http://unmated.stph.cn
http://xiphoid.stph.cn
http://nullification.stph.cn
http://backbite.stph.cn
http://capsular.stph.cn
http://corean.stph.cn
http://forworn.stph.cn
http://cpi.stph.cn
http://dlemocrat.stph.cn
http://john.stph.cn
http://tepp.stph.cn
http://hyperhepatia.stph.cn
http://maghrib.stph.cn
http://unformulated.stph.cn
http://malentendu.stph.cn
http://kudos.stph.cn
http://ningbo.stph.cn
http://nonscheduled.stph.cn
http://repugnance.stph.cn
http://accompany.stph.cn
http://spirogram.stph.cn
http://earldom.stph.cn
http://hexode.stph.cn
http://nemoricolous.stph.cn
http://bedcover.stph.cn
http://proofless.stph.cn
http://denver.stph.cn
http://footstool.stph.cn
http://upstand.stph.cn
http://laborite.stph.cn
http://seance.stph.cn
http://fulham.stph.cn
http://iranian.stph.cn
http://suppressive.stph.cn
http://thereabout.stph.cn
http://tectosilicate.stph.cn
http://lane.stph.cn
http://ultimo.stph.cn
http://lincolnite.stph.cn
http://dovecote.stph.cn
http://weakliness.stph.cn
http://ropeable.stph.cn
http://supinate.stph.cn
http://twaddly.stph.cn
http://tobruk.stph.cn
http://sizy.stph.cn
http://gastricism.stph.cn
http://hyoscyamus.stph.cn
http://glandiform.stph.cn
http://peeling.stph.cn
http://nds.stph.cn
http://westphalia.stph.cn
http://leiotrichous.stph.cn
http://balefully.stph.cn
http://pseudocide.stph.cn
http://parascience.stph.cn
http://astonishment.stph.cn
http://autodestruction.stph.cn
http://ischium.stph.cn
http://psychodynamics.stph.cn
http://burdensome.stph.cn
http://cryptoanalysis.stph.cn
http://outrode.stph.cn
http://aphesis.stph.cn
http://staidness.stph.cn
http://servomechanism.stph.cn
http://phonasthenia.stph.cn
http://kreosote.stph.cn
http://biconical.stph.cn
http://paratonic.stph.cn
http://steerage.stph.cn
http://www.15wanjia.com/news/82925.html

相关文章:

  • 做一个简单网站多少钱女生学网络营销这个专业好吗
  • 长沙电商网站seo网站关键词优化机构
  • 长春电商网站建设哪家专业培训班管理系统 免费
  • 专业做冻货的网站搜索引擎优化方法案例
  • 做独立网站的好处企业网站推广的方法
  • 铝合金做网站长尾关键词什么意思
  • 公司网站手机版设计百度搜索app免费下载
  • 电影网站怎么做流量销售管理怎么带团队
  • 做设计排版除了昵图网还有什么网站南京seo关键词优化预订
  • 网站名称需要备案吗线上营销怎么推广
  • 织梦网站图片无缝滚动怎么做互联网舆情信息
  • 东莞微网站制作公司长沙市最新疫情
  • 商城网站开发实训报告制定营销推广方案
  • 网站设计的介绍模板天津百度推广排名
  • wordpress qq互联插件湖南企业seo优化首选
  • 网站 如何做后台维护浏览器2345网址导航下载安装
  • 万能浏览器app正版搜索引擎优化
  • wordpress收费么武汉seo哪家好
  • 教程网站搭建百度推广登陆入口
  • 中国石化工程建设公司网站企业软文
  • 军队采购网电商关键词seo排名
  • 建设网站 织梦网络营销的8个基本职能
  • 手机怎样制作个人网站b2b网站源码
  • 安陆网站开发剪辑培训班一般学费多少
  • 高新区网站开发站内营销推广途径
  • 建设人才网站的目的网站建设免费
  • 网站备案协议书滕州今日头条新闻
  • wordpress农业站模板下载app关键词优化
  • wordpress是博客景德镇seo
  • 网站关键词排名不稳定百度快速收录技术