当前位置: 首页 > news >正文

全国生猪价格今日猪价行情表沧州网站优化公司

全国生猪价格今日猪价行情表,沧州网站优化公司,网站由什么构成,最佳建站模板好久没有更新,今天来一个upset图的绘制 1.1 安装包 #绘制upset的包现在看来有三个 ## UpSet ### 最基本的upsetR包,使用方便,但是扩展不方便 devtools::install_github("hms-dbmi/UpSetR") ## complex-upset ### UpSet的升级款 支持ggplot2 devtools::install_git…

好久没有更新,今天来一个upset图的绘制

1.1 安装包

#绘制upset的包现在看来有三个
## UpSet
### 最基本的upsetR包,使用方便,但是扩展不方便
devtools::install_github("hms-dbmi/UpSetR")
## complex-upset 
### UpSet的升级款 支持ggplot2
devtools::install_github('krassowski/complex-upset')
## ggupset
### 同样是UpSet的升级款 支持ggplot2
devtools::install_github("const-ae/ggupset")

示例数据

library(ggplot2)
library(ggupset)
library(ComplexUpset)
test.list <- list(set1 = c("a", "b", "c"),set2 = c("b", "c", "d", "e"),set3 = c("c", "d", "e", "f")
)

UpSetR

#对于list,利用fromlist()整理数据
UpSetR::upset(fromList(test.list), order.by = "degree", #还可以选择"degree")

UpSetR

ComplexUpset

# 要求输入的是矩阵,如果数据是list,用formlist()转化一下就可以
test.df <- fromList(test.list)
ComplexUpset::upset(test.df,intersect = colnames(test.df))
# 与UpSetR不同的是支持ggplot2语法, 例如
ComplexUpset::upset(test.df, intersect = colnames(test.df), wrap= TRUE) + ggtitle("This is a title")

ComplexUpset::upset(test.df,intersect = colnames(test.df))
ggtitle("This is a title")

ggupset

# 同样是支持ggplot2语法, 但是输入会更加复杂一些
# 主要是通过scale_x_upset()来控制upset的输出, 例如
test.df <- fromList(test.list) %>% apply(2, as.logical) %>% t() %>% as.tibble(rownames = "setsnames") %>% pivot_longer(cols = -setsnames, names_to = "Sets", values_to = "stat") %>% filter(stat) %>% select(-stat) %>% group_by(Sets) %>% summarize(Set = list(setsnames))
> test.df
# A tibble: 6 × 2Sets  Set      <chr> <list>   
1 V1    <chr [1]>
2 V2    <chr [2]>
3 V3    <chr [3]>
4 V4    <chr [2]>
5 V5    <chr [2]>
6 V6    <chr [1]>
> str(test.df)
tibble [6 × 2] (S3: tbl_df/tbl/data.frame)$ Sets: chr [1:6] "V1" "V2" "V3" "V4" ...$ Set :List of 6..$ : chr "set1"..$ : chr [1:2] "set1" "set2"..$ : chr [1:3] "set1" "set2" "set3"..$ : chr [1:2] "set2" "set3"..$ : chr [1:2] "set2" "set3"..$ : chr "set3"test.df %>% ggplot(aes(x = Set)) +geom_bar() +scale_x_upset(order_by = "degree",reverse = T, )

在这里插入图片描述

# 然后利用 ggplot2 增加亿点细节
test.df %>% ggplot(aes(x = Set)) +geom_bar() +scale_x_upset(order_by = "degree",reverse = T, )+geom_text(stat='count', aes(label=after_stat(count)), vjust=-1) + scale_y_continuous(name = "Intersection size",expand = c(0, 0), limits = c(0, 6))+theme(text = element_text(family = "ARIAL", colour = "black", size = 9))+xlab('')+theme_combmatrix(combmatrix.label.make_space = TRUE, combmatrix.label.width = NULL, combmatrix.label.height = NULL, combmatrix.label.extra_spacing = 3, combmatrix.label.total_extra_spacing = unit(10, "pt"), combmatrix.label.text = element_text(family = "ARIAL", colour = "Pink", size = 9), combmatrix.panel.margin = unit(c(1.5, 1.5), "pt"), combmatrix.panel.striped_background = TRUE, combmatrix.panel.striped_background.color.one = "white", combmatrix.panel.striped_background.color.two = "#F7F7F7", combmatrix.panel.point.size = 3, combmatrix.panel.line.size = 1.2, combmatrix.panel.point.color.fill = "red", combmatrix.panel.point.color.empty = "#E0E0E0", )+theme(panel.border = element_rect(colour = "black", fill = NA, size = 2))+theme(panel.background = element_blank(),axis.text.y = element_text(size = 9))

在这里插入图片描述

http://www.jinmujx.cn/news/113510.html

相关文章:

  • 红色企业网站源码全网营销软件
  • 保定网站优化百度推广售后客服电话
  • 网站图片修改搜狗优化排名
  • 设计导航网资源网站优化排名优化
  • wordpress cmd南京seo圈子
  • 电子商务网站建设好么张雷明任河南省委常委
  • 游戏开发 网站开发 难度seo优化seo外包
  • 优质做网站企业邮箱注册申请
  • ui培训班一般学费多少上海排名seo公司
  • 国外无版权素材网站最好的免费推广平台
  • 域名怎么进入网址四川seo快速排名
  • 微信公众号微网站怎么做湖南企业竞价优化首选
  • 永久免费建个人网站运营推广怎么做
  • wordpress自适应主题制作长沙官网seo推广
  • 广东电商网站建设今天的最新消息新闻
  • wordpress 主题广东seo网站推广代运营
  • 建设个人网站多少钱在线代理浏览国外网站
  • seo网站建设技巧网络推广产品要给多少钱
  • 美国官网amazon廊坊seo
  • 网站制作导航栏怎么做网站建设优化400报价
  • 成品在线网站免费入口软文街官网
  • 文化传媒公司网站模板公司软文推广
  • php网站上线发外链比较好的平台
  • 网站开发毕业周记谷歌引擎搜索
  • 奶茶网页设计图片seo推广公司哪家好
  • 小微企业网站建设域名ip查询
  • 领优惠券的网站是怎么做的网络广告营销的特点
  • 网站更改指定字段天津seo诊断
  • 设计网站可能遇到的问题百度上搜索关键词如何在首页
  • 下载页面设计图片seo点击器