UpSetR图
# install.packages("UpSetR")
require(UpSetR)
## Loading required package: UpSetR
movies <- read.csv( system.file("extdata", "movies.csv", package = "UpSetR"), header=T, sep=";" )
mutations <- read.csv( system.file("extdata", "mutations.csv", package = "UpSetR"), header=T, sep = ",")
head(movies)
## Name ReleaseDate Action Adventure Children
## 1 Toy Story (1995) 1995 0 0 1
## 2 Jumanji (1995) 1995 0 1 1
## 3 Grumpier Old Men (1995) 1995 0 0 0
## 4 Waiting to Exhale (1995) 1995 0 0 0
## 5 Father of the Bride Part II (1995) 1995 0 0 0
## 6 Heat (1995) 1995 1 0 0
## Comedy Crime Documentary Drama Fantasy Noir Horror Musical Mystery
## 1 1 0 0 0 0 0 0 0 0
## 2 0 0 0 0 1 0 0 0 0
## 3 1 0 0 0 0 0 0 0 0
## 4 1 0 0 1 0 0 0 0 0
## 5 1 0 0 0 0 0 0 0 0
## 6 0 1 0 0 0 0 0 0 0
## Romance SciFi Thriller War Western AvgRating Watches
## 1 0 0 0 0 0 4.15 2077
## 2 0 0 0 0 0 3.20 701
## 3 1 0 0 0 0 3.02 478
## 4 0 0 0 0 0 2.73 170
## 5 0 0 0 0 0 3.01 296
## 6 0 0 1 0 0 3.88 940
UpSet图的视图,其中包含基于交叉点中元素的附加图。
upset(movies,attribute.plots=list(gridrows=60,
plots=list(
list(plot=scatter_plot, x="ReleaseDate", y="AvgRating"),
list(plot=scatter_plot, x="ReleaseDate", y="Watches"),
list(plot=scatter_plot, x="Watches", y="AvgRating"),
list(plot=histogram, x="ReleaseDate")), ncols = 2)
)
upset(mutations, sets = c("PTEN", "TP53", "EGFR", "PIK3R1", "RB1"),
sets.bar.color = "#56B4E9",
order.by = "freq", empty.intersections = "on")