随笔分类 -  统计R

qplot(quick plot) 快速作图,能读懂就行,推荐用ggplot2适用于各种复杂图 分面 ~.
摘要:qplot( x, y, ..., data, facets = NULL, margins = FALSE, geom = "auto", xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = 阅读全文

posted @ 2022-03-02 20:38 BioinformaticsMaster 阅读(277) 评论(0) 推荐(0) 编辑

ggplot2 分面 fact_grid() facet_wrap()
摘要:> facet_grid() 可以应用多个标准对数据分组。 如qplot(carat,price,data=diamonds,alpha=I(0.2))+facet_grid(color~cut) 这里 color~cut 波浪号~ 前是分行依据 波浪号~ 后是分列依据 相比facet_wrap,f 阅读全文

posted @ 2022-03-02 15:35 BioinformaticsMaster 阅读(865) 评论(0) 推荐(0) 编辑

ggplot2 注释文本到图所展示的数据上
摘要:best_in_class <-mpg %>% group_by(class) %>%filter(row_number(desc(hwy))==1) #取每组hwy 最大的那行观测赋值给best_in_class ggplot(mpg,aes(displ,hwy))+geom_point(aes( 阅读全文

posted @ 2022-02-26 22:09 BioinformaticsMaster 阅读(313) 评论(0) 推荐(0) 编辑

R glimpse比较全的查看列,但看不到rownames
摘要:R glimpse比较全的查看列,但看不到rownames。 rownames 可以通过View() 或head() 如glimpse(mtcars) View(mtcars) rownames(mtcars) head(mtcars) 阅读全文

posted @ 2022-02-26 16:13 BioinformaticsMaster 阅读(79) 评论(0) 推荐(0) 编辑

lm() 拟合线性模型linear module
摘要:lm() 拟合线性模型linear module ,用来进行回归、single stratum方差分析,协方差分析 lm(formula,data,subset,weights,na.action,【other args】) lm(y ~ x,data) 这样是最常见设置的参数 如lm(formul 阅读全文

posted @ 2022-02-25 13:00 BioinformaticsMaster 阅读(965) 评论(0) 推荐(0) 编辑

YuLabSMU 截断部分坐标轴 留些空白
摘要:library(ggplot2) library(ggbreak) set.seed(2019-01-19) rnorm(5) rnorm(5)+4 d<-data.frame(x=1:20,y=c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22)) p1 阅读全文

posted @ 2022-02-23 21:33 BioinformaticsMaster 阅读(349) 评论(0) 推荐(0) 编辑

geom_boxplot 箱线图
摘要:ggplot(data=data1,mapping = aes(x=VARIANT_TYPE,y=NON_REF_GENOTYPE_CONCORDANCE))+geom_boxplot()+scale_y_continuous(expand=c(0,0),breaks = c(0,75,0.80,0 阅读全文

posted @ 2022-02-19 11:14 BioinformaticsMaster 阅读(376) 评论(0) 推荐(0) 编辑

R 遍历目录下所有子目录中的某类文件
摘要:testvcfdir="/jdfssz1/ST_HEALTH/P18Z10200N0124/qdNB/" testvcfList <- list.files(testvcfdir, pattern = "*.genotype.vcf.gz$", include.dirs = FALSE, full. 阅读全文

posted @ 2022-02-18 14:00 BioinformaticsMaster 阅读(115) 评论(0) 推荐(0) 编辑

R 定义函数 ,里面嵌套条件
摘要:myfunction<-function(arg1,arg2,...){ statements return (object) } 例1 function1<-function(x,y){plot(x,y) + return(x+y)}x<-rnorm(10)xy<-rnorm(10,2,3) fu 阅读全文

posted @ 2022-02-17 15:35 BioinformaticsMaster 阅读(89) 评论(0) 推荐(0) 编辑

geom_point 散点分布图 配色
摘要:1. GATK GenotypeConcordance p<-ggplot(data=data1,mapping=aes(x = TRUTH_SAMPLE,y=NON_REF_GENOTYPE_CONCORDANCE,colour=VARIANT_TYPE,shape=VARIANT_TYPE )) 阅读全文

posted @ 2022-02-16 20:50 BioinformaticsMaster 阅读(914) 评论(0) 推荐(0) 编辑

list.files() list.dirs()
摘要:list.files("./",pattern = "*.R$",include.dirs = TRUE,full.names = TRUE,recursive = TRUE) pattern 正则表达式,仅list匹配上的 recursive=TRUE 遍历子目录 full.names=TRUE 阅读全文

posted @ 2022-02-11 13:03 BioinformaticsMaster 阅读(357) 评论(0) 推荐(0) 编辑

Rstudio 使用
摘要:Rstudio script 运行单行/多行代码 选择多行代码,按下 Ctrl/command + Enter 键(或使用 Source 窗口标题栏上的 Run 按钮)。 在运行完某一段代码后,按下 Ctrl + Shift + P 键(或对应的标题栏按钮),即可重新运行上一次运行的代码段(单行或多 阅读全文

posted @ 2022-02-11 11:52 BioinformaticsMaster 阅读(611) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示