上一页 1 ··· 272 273 274 275 276 277 278 279 280 ··· 403 下一页
摘要: 1、R实现 dir() dat <- read.table("outcome.ped") dim(dat) dat <- dat[,-(1:6)] loci <- data.frame(v1 = rep(1, 2 * nrow(dat))) for (i in 1:(ncol(dat)/2)) { 阅读全文
posted @ 2021-10-31 14:50 小鲨鱼2018 阅读(143) 评论(0) 推荐(0)
摘要: 1、脚本 [root@centos79 test]# cat test.sh #!/bin/bash #step1 check ped file uniqn=$(sed 's/\r//g' $1 | cut -d " " -f 7- | sed 's/ /\n/g' | sort -u | wc - 阅读全文
posted @ 2021-10-31 12:57 小鲨鱼2018 阅读(117) 评论(0) 推荐(0)
摘要: 1、脚本只有10行,报第11行错误?? [root@centos79 test]# bash test.sh test.sh: line 11: syntax error: unexpected end of file [root@centos79 test]# cat -n test.sh 1 # 阅读全文
posted @ 2021-10-31 12:20 小鲨鱼2018 阅读(514) 评论(0) 推荐(0)
摘要: 1、点R添加至环境变量中 2、点关于 3、点高级系统设置 4、点环境变量 5、点path 6、点编辑 7、点新建 8、输入R安装的bin目录(根据个人安装的目录) 9、确定一直点 10、win + r ,输入cmd,进入dos 11、测试Rscript命令, 没有问题 12、进入工作目录 13、测试 阅读全文
posted @ 2021-10-30 22:12 小鲨鱼2018 阅读(541) 评论(0) 推荐(0)
摘要: 1、删除指定类型的文件 dir() allfile = dir() ## 目录下的所有文件 allfile txtfile <- grep("*.txt", allfile) ## 查找txt文件,返回索引 txtfile file.remove(allfile[txtfile]) ## 删除txt 阅读全文
posted @ 2021-10-30 21:17 小鲨鱼2018 阅读(2854) 评论(0) 推荐(0)
摘要: 1、启动Rstudio 2、点击tools 3、点击global options 4、点击browse 5、选择将要设定的路径,点击open 6、然后点击应用 7、重启rstudio,查看 阅读全文
posted @ 2021-10-30 20:56 小鲨鱼2018 阅读(1320) 评论(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 阅读(405) 评论(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 阅读(111) 评论(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 阅读(878) 评论(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 阅读(4486) 评论(0) 推荐(0)
上一页 1 ··· 272 273 274 275 276 277 278 279 280 ··· 403 下一页