国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

ggplot2作圖代碼——帶狀圖、玫瑰圖、森林圖、轉(zhuǎn)錄組圖

2020-05-14 12:13 作者:惡霸小猴子  | 我要投稿

視頻記得幫我三連呀,可以幫我更多漲粉滴,哈哈哈,謝謝各位


帶狀圖

# R-code:

> library(ggplot2)

# 設(shè)置工作路徑到數(shù)據(jù)存放的文件夾下

> setwd("C:\\Users\\Administrator\\Desktop\\教程文件夾")

# 讀數(shù)據(jù),數(shù)據(jù)需要提前整理

> mydata = read.csv("Journal.csv")

> NEJM = read.csv("NEJM.csv")

# 查看數(shù)據(jù),良好習(xí)慣

> mydata

> head(mydata)

> dim(mydata)

# 作圖

> ggplot(data = NEJM) +

????aes(x = Year, y = IF) +

????geom_line(color = "black",size = 1.5) +

????geom_ribbon(data = mydata, aes(ymin =

?????????????min, ymax = max), alpha = .2)+

????geom_line(data = mydata, aes(color =

???????????Journal), alpha = .2, size = 1)+

????geom_hline(yintercept = 10, color =

????????"darkgrey", size=0.5,linetype = 2)+

????geom_vline(xintercept = 2017) +

????annotate(geom = "text", x = 2016.5, y =

?????????90, label ="制高點", angle = 90) +

????labs(title = "知名期刊影響因子變化趨勢",

????subtitle = "B站up主:小猴子_愛你呀呀")+

????theme_bw()

?

?

玫瑰圖

# R-code:

> library(ggplot2)

# 設(shè)置工作路徑到數(shù)據(jù)存放的文件夾下

> setwd("C:\\Users\\Administrator\\Desktop\\教程文件夾")

# 讀數(shù)據(jù),數(shù)據(jù)需要提前整理

> mydata= read.csv("Population.csv")

# 查看數(shù)據(jù),良好習(xí)慣

> mydata

# 作圖

> ggplot(data = mydata) +

????aes(x = sample, y = aged) +

????geom_col(aes(fill = sample),width= 1)+

????scale_fill_viridis()+

????geom_col(aes(y = 15),fill="white",width

?????????????= 1,alpha = 0.5)+

????geom_col(aes(y = 13),fill="white",width

?????????????= 1)+

????coord_polar() +

theme_void()

?

森林圖

# R-code:

> library(ggplot2)# 設(shè)置工作路徑到數(shù)據(jù)存放的文件夾下

> setwd("C:\\Users\\Administrator\\Desktop\\教程文件夾")

# 讀數(shù)據(jù),數(shù)據(jù)需要提前整理

> mydata= read.csv("Tree.csv")

# 查看數(shù)據(jù),良好習(xí)慣

> mydata

> head(mydata)

> dim(mydata)

# 作圖

> ggplot(data = mydata) +

????aes(x = HR, y = id) +

????geom_errorbarh(aes(xmax = HR95H, xmin =

????HR95L),color="black",height=0,size=0.8)+

????geom_point(size = 4, shape = 18,

???????????????aes(color = pvalue)) +

????geom_vline(xintercept = 1, linetype =

???????????????"dashed", size= 1.2) +

????coord_trans(x='log2') +

????scale_x_continuous(breaks = c(0.2,0.5,

???????????????????????1,1.5, 2, 3, 5, 7))+

????labs(x = "Hazard ratios", y =

??????"Classification", color = "p value")+

????theme_bw()

?

?

轉(zhuǎn)錄組圖

# R-code:

> library(ggplot2)

> ggplot(data = diamonds) +

????aes(x = carat, y = price) +

????geom_jitter(size = 0.7, aes(color =

????????????????color)) +

????geom_smooth(color = "grey30") +

????facet_wrap(~ clarity,scales ="free_y")+

????annotate("ribbon", x = c(0, 5),

?????????????ymin = 10000, ymax = 15000,

?????????????alpha = .1, fill = "blue") +

????geom_hline(yintercept = c(10000,15000),

???????????????linetype = "dotted") +

????geom_hline(yintercept = c(12500),

???????????????linetype = "dashed") +

????scale_color_brewer(palette = "Paired")+

????labs(x = "", y = "Expression Level",

?????????color = "") +

????theme_bw()



ggplot2作圖代碼——帶狀圖、玫瑰圖、森林圖、轉(zhuǎn)錄組圖的評論 (共 條)

分享到微博請遵守國家法律
抚州市| 靖远县| 林周县| 阳曲县| 滁州市| 新田县| 华阴市| 怀化市| 文成县| 东乡| 佛山市| 江都市| 彭水| 辉县市| 陵川县| 奉节县| 丰县| 乌鲁木齐市| 邹平县| 大城县| 邵东县| 镇沅| 栾城县| 封丘县| 灵台县| 山阳县| 北安市| 瓦房店市| 蕉岭县| 河北省| 武夷山市| 全椒县| 延寿县| 大悟县| 白河县| 南部县| 千阳县| 金平| 县级市| 密云县| 东光县|