swirl 6: Subsetting Vectors
来源:互联网 发布:php网页聊天室原理 编辑:程序博客网 时间:2024/06/05 08:05
[1] NA 1.212753086 1.226772040 1.859602576 0.763847244 NA 1.791336311 NA NA
[10] NA NA NA NA NA 0.439779205 2.324976502 NA NA
[19] NA NA NA 0.009213532 NA 0.141221402 NA 0.524453811 NA
[28] NA NA 0.922737419 NA
Since NA is not a value, but rather a placeholder for an unknown quantity, the expression NA > 0 evaluates to NA. Hence we get a bunch of NAs mixed in with our positive numbers when we do this.
> x[-c(2,10)]
[1] NA 1.212753086 1.226772040 -0.332124446 1.859602576 0.763847244 NA 1.791336311
[9] NA NA NA NA -0.262890059 NA NA -0.539133551
[17] NA -0.940835275 -0.396005495 -0.556808402 0.439779205 2.324976502 NA NA
[25] NA NA NA 0.009213532 NA 0.141221402 NA 0.524453811
[33] -0.207030473 NA NA NA 0.922737419 NA
“-”标示去除
> names(vect)
[1] "foo" "bar" "norf"
names()
> identical(names(vect),names(vect2))
[1] TRUE
identical() The identical() function tells us if its first two arguments are, well, identical.
> vect["bar"]
bar
2
"name of vector"向量中元素名,(加引号)可以直接返回元素名元素值
- swirl 6: Subsetting Vectors
- learning R with swirl-subsetting vectors(子集向量)
- swirl 4: Vectors
- learning R with swirl-vectors
- R Programming week1-Subsetting
- C++ Vectors
- vectors.S
- term vectors
- C++ Vectors
- C++ Vectors
- Gradient Vectors
- C++ Vectors
- Vectors.dense()
- ARM64 vectors
- swirl 5: Missing Values
- swirl 8: Logic
- swirl 9: Functions
- 图像特效---Swirl滤镜
- 第12章:单选扭(RadioButton)和复选框(CheckBox)的功能和用法
- 双指针
- HDU 1406 完数
- QT下实现将图片从一个文件拷贝到另一个文件夹
- Windows下命令安装MySQL.zip压缩包以及修改MySQL密码
- swirl 6: Subsetting Vectors
- sendmail 发送html 的邮件
- hdu5277 YJC counts stars(最大团)
- [LeetCode]Contains Duplicate II
- POJ 1316 Self Numbers 筛选模拟
- Intellij--File Status Highlights文件高亮规则
- Android学习日志: 执行.getResponseCode()方法时出现错误常
- HMM隐马尔可夫
- 快速幂模板