摘要:
001、 1、矩阵转换为三元组 num <- c(5, 2, 7, 0, 9, 3, 4, 2, 3, 1, 7, 8) dat <- matrix(num, nrow = 3, ncol = 4, byrow = T) dat rows <- rep(1:nrow(dat), each = nco 阅读全文
posted @ 2022-06-01 16:29
小鲨鱼2018
阅读(769)
评论(0)
推荐(0)
摘要:
1、输出列的累加和 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt 8 4 2 2 8 3 1 3 4 3 4 6 [root@PC1 test2]# awk '{sum += $1} {print sum}' a.txt ## 第一列累 阅读全文
posted @ 2022-06-01 13:30
小鲨鱼2018
阅读(2714)
评论(0)
推荐(0)
摘要:
001、删除含有空值的行 a <- c(3, NA, 4, 7, NA, 8) b <- c(1:2, NA, 3:5) c <- c(NA, "a", "k", "b", "c", "d") dat <- data.frame(a, b, c) dat na.omit(dat) ## 删除所有有空 阅读全文
posted @ 2022-06-01 11:36
小鲨鱼2018
阅读(13409)
评论(0)
推荐(0)

浙公网安备 33010602011771号