上一页 1 ··· 296 297 298 299 300 301 302 303 304 ··· 408 下一页
摘要: linux系统中如何删除空行。 1、测试数据 a.txt [root@centos79 test]# ls a.txt [root@centos79 test]# cat a.txt a g r e i x k like a f g liker [root@centos79 test]# cat - 阅读全文
posted @ 2021-07-04 20:17 小鲨鱼2018 阅读(339) 评论(0) 推荐(0)
摘要: 1、 [root@centos79 test]# cat a.txt a g r e u c j alike i x k like a f g liker a f h g liker s g e g [root@centos79 test]# grep "^a" a.txt ## 查找以a开头的行 阅读全文
posted @ 2021-07-04 19:37 小鲨鱼2018 阅读(9477) 评论(0) 推荐(0)
摘要: 1、测试数据 [root@centos79 test]# ls a.txt [root@centos79 test]# cat a.txt a g e u c j alike i x k like w f g liker s g e g [root@centos79 test]# echo "b.t 阅读全文
posted @ 2021-07-04 19:18 小鲨鱼2018 阅读(959) 评论(0) 推荐(0)
摘要: 1、测试数据 [root@centos79 test]# cat a.txt a g e u c j alike i x k like w f g liker s g e g [root@centos79 test]# grep like a.txt u c j alike i x k like w 阅读全文
posted @ 2021-07-04 18:57 小鲨鱼2018 阅读(689) 评论(0) 推荐(0)
摘要: linux系统中如何删除文件的最后几行 1、 [root@centos79 test]# cat a.txt a g e d c j i x a e i r x v b x e w [root@centos79 test]# head -n -2 a.txt a g e d c j i x a e 阅读全文
posted @ 2021-07-04 18:14 小鲨鱼2018 阅读(1013) 评论(0) 推荐(0)
摘要: 1、linux系统中如何统计文件的行数 [root@centos79 test]# cat b.txt a g e d c j i x a [root@centos79 test]# wc -l b.txt 3 b.txt 2、 [root@centos79 test]# cat b.txt a g 阅读全文
posted @ 2021-07-04 17:58 小鲨鱼2018 阅读(1220) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-07-03 13:52 小鲨鱼2018 阅读(240) 评论(0) 推荐(0)
摘要: 1、自定义函数 test1 <- function(x = 5,y) ## 自定义函数test { a = x / y print(a) } test1(10,100) ## 使用位置参数,按顺序x = 10, y = 100 test1(y = 10, x = 100) ## 关键字参数 直接定义 阅读全文
posted @ 2021-06-29 22:09 小鲨鱼2018 阅读(1802) 评论(0) 推荐(0)
摘要: 1、 rm(list = ls()) dir() for (i in list.files(pattern=".r$")) { source(i) } 2、 rm(list = ls()) dir() for (i in dir()) { if(substr(i,nchar(i)-1,nchar(i 阅读全文
posted @ 2021-06-29 00:16 小鲨鱼2018 阅读(154) 评论(0) 推荐(0)
摘要: R语言中如何在函数内部定义全局变量。 1、在函数内部定义的变量无法在函数外调用 test1 <- function(x, y) { a <- x + y print(a) } test1(10,20) print(a) 2、在函数内定义全局变量 test2 <- function(x, y) { a 阅读全文
posted @ 2021-06-29 00:00 小鲨鱼2018 阅读(1452) 评论(0) 推荐(0)
上一页 1 ··· 296 297 298 299 300 301 302 303 304 ··· 408 下一页