当前位置:网站首页>R language uses circular statements to draw multiple pictures at one time
R language uses circular statements to draw multiple pictures at one time
2022-07-17 23:18:00 【A Qiang Zhen】
R Language uses circular statements to draw multiple pictures at one time
First load the package ,patchwork It is used to display multiple pictures in one interface
See this article for details
library(ggplot2)
library(patchwork)
With data iris For example , Respectively by Sepal.Length Sepal.Width Petal.Length Petal.Width Draw a violin diagram for the ordinate
Articles related to violin pictures
iris
ggplot(iris,aes(Species,Sepal.Length))+
geom_violin(aes(col=Species))

Draw pictures with circular statements :
Extract column names first :
a <- colnames(iris[,-5]);a
for (i in 1:4){
F0 <- ggplot(iris,aes_string("Species",a[2]))+
geom_violin(aes(col=Species))
pic <- paste0("F",i)
assign(pic,F0)
}
(F1+F2)/(F3+F4)


Be careful : It's used here aes_string instead of aes,Species Be sure to use double quotation marks , When we extract the vertical coordinates, there are double quotation marks , Don't add this
边栏推荐
- Market Research and investment strategy report of China's high purity magnesium oxide industry (2022 Edition)
- 科技公司纷纷反对,英国网络安全法案搁置
- How to realize the association between interfaces in JMeter?
- Pytorch custom loss function, optimizer, and learning rate policy
- Proxmox VE 7.2 iso 镜像重置 pve root密码
- sql-client. Can checkpoint be set for SH submission task?
- Flink's diversified exploration and practice in station B
- Week 4 – Linear Text Classification
- YOLO系列论文精度 & YOLOv2 and YOLO9000
- Cyber Nuwa, how to make digital people?
猜你喜欢

Proxmox ve 7.2 ISO image reset PVE root password

联通实时计算平台演进与实践

赛博女娲,怎么造数字人?

Apache Flink 在翼支付的实践应用

An eight year road of Software Testing Engineer

Apache Flink's practice in mobile cloud real-time computing

Software testing interface testing practice wechat official account platform postman+newman+jenkins realizes automatic report generation and continuous integration

Proxmox ve 7.2 LxC deployment openwrt

Image fire detection system based on YCbCr GUI system based on matkab

Application of Flink in Zhongan insurance financial business
随机推荐
IPv6 navigation, strong sail pointing application
VMware Photon OS 4 Install
Redis key notification related notes (event notification)
慢 SQL 分析与优化
Communication between WEMOS and raspberry pie
VMware Photon OS 4 Install
Proxmox ve 7.2 ISO image reset PVE root password
Application scheme for remote monitoring of Wutong Bolian photovoltaic power station
What is the relationship between the tablespace of polardb for PostgreSQL and the database?
HCIP第七天笔记
Image fire detection system based on YCbCr GUI system based on matkab
Format transformation commonly used by grafana
How to import the data in a table into the corresponding database website
基于matab GUI的图形处理火焰检测系统
WeMos和树莓派的通信
What is Oracle's user and authority system?
Practice and application of Flink flow processing in CSC securities
Switch and router technology: static route configuration and DHCP and VLAN configuration on the router
vs2019社區版下載教程(詳細)
包及内置模块与软件开发目录规范