R

R终端输出

1 message()函数 2 改变输出字体颜色和格式 3 一些常用的特殊字符 1 message()函数 可以使用message()函数进行终端屏幕输出.

ggraph画网络图

1 安装 2 构建所需要的数据 2.1 构建edges数据 2.2 然后构建node的数据 2.3 构建ggraph所需的数据 3 画图 3.1 基础绘图 3.2 添加文字 3.3 使用不同的lay

SAM test用于差异标志物的选择

参考文献1,2. 示例代码: # Function to compute the smooth threshold curve smooth.threshold=function(x,ta,s0,df){ xp=x[x>(ta*s0)]; xn=x[x<(-ta*s0)]; dp=xp/ta-s0; dn=xn/(-ta)-s0; dp=s0/dp; dp=ta*(1+dp); dn=s0/dn; dn=ta*(1+dn); fp=pt(dp,df=df); fn=pt(dn,df=df); yp=-log10(2*(1-fp)); yn=-log10(2*(1-fn)); return(cbind(c(xn,xp),c(yn,yp))); } # Get data library(cp4p); data(LFQRatio2); tabl=LFQRatio2; ## Warning: package 'cp4p' was built under R version 3.6.1 ## Loading required package: MESS ## Warning: package 'MESS' was built under R version 3.6.1 ## Loading required

blogdown创建post模板文件夹

blogdown好像并没有自动创建post模板文件夹的函数,要达到的目的是,自动在content/en/post中创建文件夹,然后文件夹中有

ggplot2做蝴蝶图

使用ggplot2画蝴蝶图. library(tidyverse) ## Warning: package 'tidyverse' was built under R version 3.6.1 ## -- Attaching packages ------------------------------------------------------------------------ tidyverse 1.2.1 -- ## v ggplot2 3.2.1 v purrr 0.3.2 ## v tibble 2.1.3 v dplyr 0.8.3 ## v tidyr 1.0.0 v stringr 1.4.0 ## v readr 1.3.1 v forcats 0.4.0 ## Warning: package 'ggplot2' was built under R version