上一页 1 ··· 277 278 279 280 281 282 283 284 285 ··· 408 下一页
摘要: 1、启动Rstudio 2、点击tools 3、点击global options 4、点击browse 5、选择将要设定的路径,点击open 6、然后点击应用 7、重启rstudio,查看 阅读全文
posted @ 2021-10-30 20:56 小鲨鱼2018 阅读(1328) 评论(0) 推荐(0)
摘要: 1、 dir() dat <- read.table("outcome.ped") dat <- dat[,-(1:6)] loci <- data.frame() loci[1:(nrow(dat) * 2), 1] <- 1 for (i in 1:(ncol(dat)/2)) { loci < 阅读全文
posted @ 2021-10-30 19:03 小鲨鱼2018 阅读(414) 评论(0) 推荐(0)
摘要: 1、 [root@centos79 test]# cat test.sh #!/bin/bash #step1 check consistence of columns temp1=`head -n 1 $1 | awk '{print NF}'` for i in $(seq `sed -n "$ 阅读全文
posted @ 2021-10-30 15:46 小鲨鱼2018 阅读(113) 评论(0) 推荐(0)
摘要: 1、 a <- c(1, 3, 4, 7, 9) sum_a = 0 for (i in 1:length(a)) { sum_a = sum_a + a[i] } mean_a = sum_a / length(a) va = 0 for (i in 1:length(a)) { va = va 阅读全文
posted @ 2021-10-29 23:09 小鲨鱼2018 阅读(881) 评论(0) 推荐(0)
摘要: 1、rbind, 按行合并数据框 a <- 1:3 b <- 5:7 c <- 9:11 d <- data.frame(a, b, c) d e <- 11:13 f <- 15:17 g <- 19:21 h <- data.frame(e, f, g) h rbind(d, h) ## 列名不 阅读全文
posted @ 2021-10-29 22:45 小鲨鱼2018 阅读(4505) 评论(0) 推荐(0)
摘要: R中%in%用于判断前一个向量的元素是否在后一个向量中, 返回逻辑值。 1、 a <- c(3,1,8,9) b <- c(2, 3, 4, 8, 10) a %in% b 利用此关系可以取出向量a、和向量b的交集, 可以取出向量a中不包含在向量b中的项 a <- c(3,1,8,9) b <- c 阅读全文
posted @ 2021-10-29 22:31 小鲨鱼2018 阅读(4355) 评论(0) 推荐(1)
摘要: 1、echo liujiaxin01@PC1:~/test$ ls a.txt liujiaxin01@PC1:~/test$ cat a.txt 01 02 03 04 05 06 07 08 09 10 liujiaxin01@PC1:~/test$ echo "" >> a.txt liuji 阅读全文
posted @ 2021-10-29 11:23 小鲨鱼2018 阅读(1936) 评论(0) 推荐(1)
摘要: 列转行 1、paste liujiaxin01@PC1:~/test$ seq -f %02g 10 01 02 03 04 05 06 07 08 09 10 liujiaxin01@PC1:~/test$ seq -f %02g 10 > a.txt liujiaxin01@PC1:~/test 阅读全文
posted @ 2021-10-29 11:18 小鲨鱼2018 阅读(5679) 评论(0) 推荐(0)
摘要: 1、 a <- 1:5 b <- 3:7 c <- 5:9 d <- 4:8 e <- data.frame(a, b, c, d) e e[e == 5] = 500 e 2、在指定列替换 a <- 1:5 b <- 3:7 c <- 5:9 d <- 4:8 e <- data.frame(a, 阅读全文
posted @ 2021-10-28 20:46 小鲨鱼2018 阅读(1115) 评论(0) 推荐(0)
摘要: 1、 a <- 1:5 b <- 3:7 c <- 5:9 d <- data.frame(a, b, c) unique(c(d$a, d$b, d$c)) 2、 a <- 1:5 b <- 3:7 c <- 5:9 d <- data.frame(a, b, c) e <- vector() f 阅读全文
posted @ 2021-10-28 19:58 小鲨鱼2018 阅读(220) 评论(0) 推荐(0)
上一页 1 ··· 277 278 279 280 281 282 283 284 285 ··· 408 下一页