03 2023 档案
摘要:001、判断是否末尾有空格 (base) [root@PC1 test]# ls a.txt (base) [root@PC1 test]# cat a.txt ## 测试数据 a d g k u d d g k d f , z d g dfe jh (base) [root@PC1 test]#
阅读全文
摘要:001、生成测试子图 library(ggplot2) library(dplyr) ## 依次生成测试子图p1、p2、p3、p4 p1 <- ggplot(mpg) + geom_point(aes(x = displ, y = hwy)) + ggtitle("P1") p2 <- ggplot
阅读全文
摘要:001、生成几个测试数据 library(ggplot2) library(dplyr) p1 <- ggplot(mpg) + geom_point(aes(x = displ, y = hwy)) + ggtitle("P1") ## 测试图p1 p2 <- ggplot(mpg) + geom
阅读全文
摘要:解决方法: 001、在安装目录中手动删除:rlang目录,例如此处windows默认的安装目录:C:\Users\ljx\AppData\Local\R\win-library\4.2;安装目录的获取方法,在终端执行: .libPaths() 002、然后再R中(不是Rstudio)重新安装: in
阅读全文
摘要:001、默认绘图 bp <- ggplot(PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() ## 绘图 bp ## 输出图片 002、上部 bp + theme(legend.position="top") ## 放
阅读全文
摘要:001、正常绘图 library(ggplot2) bp <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() bp ## 显示绘图结果 002、修改图例标题的名称 bp + scale_fi
阅读全文
摘要:001、正常绘图,显示图例 library(ggplot2) bp <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() ## 绘图 bp ## 显示绘图 绘图结果如下: 002、隐藏图例的标
阅读全文
摘要:001、直接绘图效果: library(ggplot2) bp <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() ## 绘图 bp ## 显示绘图结果 绘图结果如下: 002、修改图例显示
阅读全文
摘要:001、 a、利用测试数据绘制箱线图 library(ggplot2) bp <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() ## 绘图 bp ## 显示绘图结果 绘图结果如下: b、移
阅读全文
摘要:001、使用绘制散点图进行测试。 a、直接绘制散点图 x <- 1:10 y <- seq(1, 1000, 100) dat <- data.frame(x, y) ## 生成测试数据 ggplot(dat, aes(x, y)) + geom_point() ## 直接绘制散点图 绘图结果如下:
阅读全文
摘要:001、 利用绘制散点图进行测试 a、直接绘制散点图 x <- 1:10 y <- seq(1, 1000, 100) dat <- data.frame(x, y) ## 生成测试数据 ggplot(dat, aes(x, y)) + geom_point() ## 直接绘制散点图 绘图结果如下:
阅读全文
摘要:001、 (base) [root@PC1 test3]# ls ## 测试数据及脚本 a.txt test.py (base) [root@PC1 test3]# cat test.py ## 复制程序 import os os.popen('cp a.txt b.txt') ## windows
阅读全文
摘要:001、theme_classic() 主题用来去除背景 a、使用默认的背景 type <- c('A', 'B', 'C', 'D', 'E', 'F', 'G') nums <- c(10,23,8,33,12,40,60) df <- data.frame(type = type, nums
阅读全文
摘要:001、生成测试数据以及测试 library(ggplot2) x <- paste0("s", 1:16) y <- 4:19 dat <- data.frame(x, y) ## 生成测试数据框 dim(dat) head(dat, 3) ggplot(dat,aes(x,y))+ geom_p
阅读全文
摘要:001、 基础绘图 type <- c('A', 'B', 'C', 'D', 'E', 'F', 'G') nums <- c(10,23,8,33,12,40,60) df <- data.frame(type = type, nums = nums) ## 生成的测试数据框 df ggplot
阅读全文
摘要:001、 (base) [b20223040323@admin1 test]$ ls a.txt b.txt (base) [b20223040323@admin1 test]$ cat a.txt ## 测试数据 GENE=3BHSD 1 1 GENE=A3GALT2 1 1 GENE=A1BG
阅读全文
摘要:001、 factorial(2) ## 计算2的阶乘 factorial(3) ## 计算3的阶乘 factorial(4)
阅读全文
摘要:R语言中exp函数用于返回e的x次方。 exp(2) ## 返回e的二次方 2.718281828459 * 2.718281828459 exp(3) ## 返回e的三次方 2.718281828459 * 2.718281828459 * 2.718281828459
阅读全文
摘要:Fisher's 精确检验 用来检验一次随机实验的结果是否支持对于某个随机实验的假设。 a、随机事件发生的概率小于0.05则认定该事件为小概率事件。 b、一般原则认为在某个假设前提下,一次随机实验的结果不会出现小概率事件。 c、若一次随机实验的结果出现了小概率事件则认定该假设不被支持。 在给定假设(
阅读全文
摘要:001、 dat <- c("a", "k", "a", "b", "q") ## 测试字符串向量 grep("a", dat) ## grep匹配字符串,返回索引值 grepl("a", dat) ## grepl匹配字符串, 返回向量中匹配的布尔值
阅读全文
摘要:今天遇到一个小问题,要提取文件的行首和行尾指定的行数, 不想生成中间文件, 一时没有想出来怎么处理,后来想到一个组合命令实现。如下: 001、 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt ## 测试数据 01 02 03 04 05
阅读全文
摘要:测试plink 软件中 --recode 12 做了什么。 001、首选看一下plink格式的测试数据 [root@PC1 test01]# ls outcome.map outcome.ped [root@PC1 test01]# cat outcome.map ## 一共5个位点 1 snp1
阅读全文
摘要:001、测试数据如下: [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt 1 0 1 0 1 0 1 1 1 1 1 1 1 0 0 0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 1 1 以上测试数据中,行为样本,也就是以此为
阅读全文
摘要:今天遇到一个比较2的问题。 001、word中字体、字号都一样,而且行间距都是单倍行距,但是看着行距明显不一样,如下图所示: 就是1和2中的行距明显不一样,哪里出了问题??? 002、 查了一下, 有可能是文档网格的原因导致的,可以这样解决。 其中的第4步骤中,打开默认是44, 调整为42,然后点击
阅读全文
摘要:测试数据链接: 链接:https://pan.baidu.com/s/18_R3W1K7DYdUA9DxGZ0jxw 提取码:nklh --来自百度网盘超级会员V6的分享 背景知识: 将质控后的fastq文件比对到参考基因组之后,有可能会有部分染色体根本比对不上。 比如参考基因组中一共有10条染色体
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt b.txt [root@PC1 test]# cat a.txt ## 测试数据a.txt gene exon gene exon exon exon exon [root@PC1 test]# awk 'BEGIN{idx=0} {if
阅读全文