摘要: 1、 gender <- rep(c("male", "female"), 2) age <- c(20, 30, 26, 32) height <- c(170, 180, 175, 178) dat <- data.frame(gender, age, height) dat aggregate 阅读全文
posted @ 2022-05-21 18:35 小鲨鱼2018 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 95%的置信区间? 1、 set.seed(100) a <- rnorm(100) library(car) qqPlot(a, main="qq plot", col="blue", col.lines="red") ## 绘图 阅读全文
posted @ 2022-05-21 14:09 小鲨鱼2018 阅读(768) 评论(0) 推荐(0) 编辑
摘要: filter函数的使用需要加载dplyr包 1、 a <- 1:10 b <- sample(10, 10) c <- rep(letters[1:5], each = 2) dat <- data.frame(a, b, c) dat library(dplyr) filter(dat, a < 阅读全文
posted @ 2022-05-21 12:21 小鲨鱼2018 阅读(1437) 评论(0) 推荐(0) 编辑
摘要: 管道符的作用:将前一个命令的输出作为后一个命令的输入。 管道符命令的使用需要用到dplyr包。 001、在函数中应用 library(dplyr) f1 <- function(x){return(x + 10)} f2 <- function(x){return(x * 2)} ## 首先定义两个 阅读全文
posted @ 2022-05-21 11:36 小鲨鱼2018 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt d u s x e j z c e e f a x f e w f e 2、提取包含字符x的数据 root@PC1:/home/test2# ls a.txt 阅读全文
posted @ 2022-05-21 00:15 小鲨鱼2018 阅读(1358) 评论(0) 推荐(0) 编辑