摘要:
001、 library(randomcoloR) palette <- randomColor(count = 54) #随机生成60种颜色,其实里面有重复的 palette <- distinctColorPalette(54) #差异明显的60种 palette plot(1:54, pch 阅读全文
摘要:
001、R语言中points 函数 plot(1:5, 1:5, xlim = c(1,6), ylim = c(1,6), type = "n") points(c(3,3), c(2,5), cex = 2, col = "red", pch = 13) 002、 调整大小、颜色 plot(1: 阅读全文
摘要:
R语言中数据框中如何实现按照指定列的类别进行排序。 001、 dir() c1 <- rep(c("b","d", "a", "c"), each = 2) c1 c2 <- sample(1:20, 8) c2 dat <- data.frame(c1, c2) ## 生成一个测试数据 idx < 阅读全文
摘要:
Linux 中sed命令的整行替换. 001、基本用法 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt ## 测试文件 a UU i a UU i b q j c q y [root@PC1 test2]# sed '/b/ s/.*/Q 阅读全文
摘要:
001、 Linuxbash和source命令的区别在于,当你用bash命令执行脚本时,它告诉Linux内核创建一个新的Bash进程来读取和执行脚本,将输出复制到原先的shell进程中,并显示下来. 然而source命令是一个外置的shell,它读取和评估当前shell进程中的文件。为此,脚本所做的 阅读全文
摘要:
001、 创建数组 a、 declare -a array1 。 b、 array1[0]=100 。 002、删除数组 unset array1 。 003、查看数组 a、查看数组所有的元素: [root@PC1 test]# array1[0]=100 [root@PC1 test]# arra 阅读全文
摘要:
001、关联数组的声明 declare -A array1 002、关联数组的赋值 [root@localhost test]# declare -A array1 [root@localhost test]# array1["a"]=1000 [root@localhost test]# arra 阅读全文
摘要:
Linux 中declare命令 001、普通测试 [root@PC1 dir1]# ls [root@PC1 dir1]# echo $var1 [root@PC1 dir1]# var1="hello world" [root@PC1 dir1]# echo $var1 hello world 阅读全文
摘要:
001、 Linux 中export命令 阅读全文
摘要:
001、-L :按照换行符的数量来传递 [root@PC1 dir1]# ls [root@PC1 dir1]# echo {0..9} 0 1 2 3 4 5 6 7 8 9 [root@PC1 dir1]# echo {0..9} | xargs -L 2 ## 利用echo生成一个1行的测试数 阅读全文