摘要: 1、 > a <- c(3, 8, 2, 4, 7) > b <- c(2, 9, 4, 7, 3) > a [1] 3 8 2 4 7 > b [1] 2 9 4 7 3 > pmax(a, b) ## 返回两组向量中的最大值 [1] 3 9 4 7 7 > pmin(a, b) ## 返回两组向 阅读全文
posted @ 2022-04-02 15:48 小鲨鱼2018 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 1、测试1 > a <- 1:10 > a [1] 1 2 3 4 5 6 7 8 9 10 > rev(a) ## 逆向输出a [1] 10 9 8 7 6 5 4 3 2 1 > a <- c("aaa", "bbb", "ccc", "ddd") > a [1] "aaa" "bbb" "cc 阅读全文
posted @ 2022-04-02 15:29 小鲨鱼2018 阅读(523) 评论(0) 推荐(0) 编辑
摘要: 1、R语言中cumsum函数用于求累积和 > a <- 1:5 > a [1] 1 2 3 4 5 > cumsum(a) ## 求累积和 [1] 1 3 6 10 15 阅读全文
posted @ 2022-04-02 15:16 小鲨鱼2018 阅读(527) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 [root@centos7pc1 test2]# cat test.txt 1 x c 2 s d 3 e t 4 d s 5 j u 6 n x 2、程序 [root@centos7pc1 test2]# cat swap.sh #!/bin/bash temp1=$(sed -n 阅读全文
posted @ 2022-04-02 14:31 小鲨鱼2018 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 1、直接测试 [root@centos7pc1 test3]# ls test.sh [root@centos7pc1 test3]# cat test.sh ## 测试脚本 #!/bin/bash NUM=3 while [ $NUM -gt 0 ] ## 循环条件 do echo "xxxxx" 阅读全文
posted @ 2022-04-02 13:03 小鲨鱼2018 阅读(243) 评论(0) 推荐(0) 编辑
摘要: $RANDOM 是linux中的内置变量,可以随机生成 0~32767之间的整数数字。 1、取0~9的随机数 [root@centos7pc1 test3]# ls [root@centos7pc1 test3]# expr $RANDOM % 10 7 [root@centos7pc1 test3 阅读全文
posted @ 2022-04-02 12:16 小鲨鱼2018 阅读(554) 评论(0) 推荐(0) 编辑
摘要: 1、expr命令实现在命令行中的四则运算 [root@centos7pc1 test3]# ls [root@centos7pc1 test3]# expr 10 + 5 ## 数字和运算符的两侧必须有空格 15 [root@centos7pc1 test3]# expr 10+5 10+5 [ro 阅读全文
posted @ 2022-04-02 11:57 小鲨鱼2018 阅读(597) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 [root@centos7pc1 test3]# ls a.txt [root@centos7pc1 test3]# cat a.txt ddfg uujj mmkk xxuu zzdd mmuh zzvv ddee 2、sed实现 [root@centos7pc1 test3]# l 阅读全文
posted @ 2022-04-02 11:10 小鲨鱼2018 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 1、直接测试 [root@centos7pc1 test3]# ls [root@centos7pc1 test3]# a=10 [root@centos7pc1 test3]# echo $a 10 [root@centos7pc1 test3]# b=a+5 ## 变量没有$则直接输出了变量名 阅读全文
posted @ 2022-04-02 10:10 小鲨鱼2018 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 [root@centos7pc1 test3]# ls a.txt [root@centos7pc1 test3]# cat a.txt GGTGCAATAT GGTGCAATAT GGTGCAATAT GGTGCAATAT 2、将连续的字符转换为中间具有空格的字符 [root@cen 阅读全文
posted @ 2022-04-02 09:18 小鲨鱼2018 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 1、问题samtools安装报错:configure: WARNING: S3 support not enabled: requires SSL development files 2、解决方法: [root@centos7pc1 samtools-1.15]# yum install gcc g 阅读全文
posted @ 2022-04-02 08:31 小鲨鱼2018 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 1、问题samtools安装报错:configure: WARNING: libcurl not enabled: library not found 2、解决方法 [root@centos7pc1 samtools-1.15]# yum install libcurl-devel -y 阅读全文
posted @ 2022-04-02 08:26 小鲨鱼2018 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 1、问题 samtools安装报错:configure: error: liblzma development files not found 2、解决方法 [root@centos7pc1 samtools-1.15]# yum install xz-devel -y 阅读全文
posted @ 2022-04-02 08:22 小鲨鱼2018 阅读(712) 评论(0) 推荐(0) 编辑
摘要: 1、问题samtools安装报错 configure: error: libbzip2 development files not found 2、解决方法 [root@centos7pc1 samtools-1.15]# yum install bzip2-devel -y 阅读全文
posted @ 2022-04-02 08:19 小鲨鱼2018 阅读(742) 评论(0) 推荐(0) 编辑
摘要: 1、问题 samtools安装报错:configure: error: zlib development files not found 2、解决方法 [root@centos7pc1 samtools-1.15]# yum install zlib zlib-devel 阅读全文
posted @ 2022-04-02 08:16 小鲨鱼2018 阅读(497) 评论(0) 推荐(0) 编辑