最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(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)錄組圖的評論 (共 條)

分享到微博請遵守國家法律
寿光市| 满城县| 博野县| 屏山县| 青川县| 龙海市| 安达市| 紫金县| 淄博市| 石屏县| 镇安县| 崇信县| 图木舒克市| 炉霍县| 万山特区| 汕头市| 康保县| 荔浦县| 同心县| 营山县| 南丹县| 通许县| 辉南县| 大足县| 七台河市| 香格里拉县| 宁海县| 普安县| 乌兰县| 女性| 玉林市| 吉木萨尔县| 曲阳县| 德清县| 巴林左旗| 怀化市| 宜都市| 垦利县| 昆山市| 沈丘县| 双峰县|