上一页 1 ··· 203 204 205 206 207 208 209 210 211 ··· 367 下一页
摘要: 001、无放回抽样 > a <- 1:5 ## a为数值向量 > a [1] 1 2 3 4 5 > sample(a, 3) ## 从a中任意抽取3个 [1] 3 1 2 > sample(a, 3) ## 从a中任意抽取3个 [1] 4 1 2 默认为无放回抽样,一个元素不能抽取两次, 除非本身 阅读全文
posted @ 2022-04-25 17:20 小鲨鱼2018 阅读(779) 评论(0) 推荐(0) 编辑
摘要: 列表是R的数据结构中最为复杂的一种。 一般来说,列表就是一些对象的有序集合。 对象可以是向量、矩阵、数据框、列表等,可以使用list函数来创建列表。 > g <- "xxxxx" ## 字符串 > h <- c(2, 4, 3) ## 数值向量 > j <- matrix(1:15, nrow = 阅读全文
posted @ 2022-04-25 16:46 小鲨鱼2018 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 数组: 不同于矩阵和数据框,维度大于2。 R中最简单的数组:3维。(行, 列, 面),如下两行、三列、四面的数组。 > dim1 <- c("a1", "a2") > dim2 <- c("b1", "b2", "b3") > dim3 <- c("c1", "c2", "c3", "c4") > 阅读全文
posted @ 2022-04-25 16:32 小鲨鱼2018 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 1、 > for (i in seq(1, 10)){ + var <- paste0('var', i) ## 变量名 + data <- i + 10 ## 变量值 + assign(var, data) ## 把变量值分配给变量名 + } 阅读全文
posted @ 2022-04-25 10:15 小鲨鱼2018 阅读(2164) 评论(0) 推荐(0) 编辑
摘要: 1、 install.packages("devtools") library("devtools") install_github('royfrancis/pophelper') library(pophelper) 阅读全文
posted @ 2022-04-24 21:47 小鲨鱼2018 阅读(732) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt ## 测试数据 d eee j x ee u d eeeee d a e u k q j eeee sj a d 阅读全文
posted @ 2022-04-24 18:43 小鲨鱼2018 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt d ees j x e.s u z e s u w e s u root@DESKTOP-1N42TVH:/ho 阅读全文
posted @ 2022-04-24 18:28 小鲨鱼2018 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt d ees j x e.s u z e s u w e s u root@DESKTOP-1N42TVH:/ho 阅读全文
posted @ 2022-04-24 18:23 小鲨鱼2018 阅读(610) 评论(0) 推荐(0) 编辑
摘要: 1、linux 中 grep -q选项表示静默输出, 即不显式匹配结果 root@DESKTOP-1N42TVH:/home/test2# ls a.txt root@DESKTOP-1N42TVH:/home/test2# cat a.txt ## 测试数据 d e j s q u z c b r 阅读全文
posted @ 2022-04-24 17:51 小鲨鱼2018 阅读(2531) 评论(0) 推荐(0) 编辑
摘要: 1、 root@DESKTOP-1N42TVH:~# echo "/etc/init.d/ssh start" >> /etc/profile 阅读全文
posted @ 2022-04-24 13:09 小鲨鱼2018 阅读(159) 评论(0) 推荐(0) 编辑
上一页 1 ··· 203 204 205 206 207 208 209 210 211 ··· 367 下一页