我有数千条记录。每个记录具有12个连续变量,样本的国家/地区信息和国家/地区所属的国家/地区属于该国家/地区。我使用这12个功能在R中进行了绘制。现在,我想通过在属于每个大洲的酒吧周围放置边框来对这些酒吧进行分组。这就是我用代码制作的
barplot(t(as.matrix(subset(ordered, select=V1:V12))), col=rainbow(12), border=NA, names.arg=barNaming(ordered$Continent), las=2)
以下是我的数据的子集。
structure(list(V1 = c(0.99989, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05), V2 = c(1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1.6e-05, 1e-05, 1e-05, 1e-05, 0.110828, 0.122412,
1e-05), V3 = c(1e-05, 0.99989, 0.584081, 0.971754, 0.99989, 0.099645,
1e-05, 0.78751, 0.99989, 0.811221, 1e-05, 1e-05, 0.99989, 0.99989,
0.99989, 0.99989, 0.665115, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
0.889072, 0.538943, 0.99989), V4 = c(1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 0.99989, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05), V5 = c(1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05), V6 = c(1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 0.188371, 1e-05, 0.188679, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05), V7 = c(1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 0.705766,
1e-05, 1e-05, 1e-05, 1e-05, 0.99989, 0.99989, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 0.977081, 0.99989, 0.99989, 0.99989, 1e-05,
0.338555, 1e-05), V8 = c(1e-05, 1e-05, 0.415819, 0.028146, 1e-05,
0.194499, 1e-05, 0.024029, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 0.334785, 1e-05, 0.022813, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05), V9 = c(1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 0.99989, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05), V10 = c(1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05), V11 = c(1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05), V12 = c(1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05
), Population = structure(c(43L, 63L, 12L, 12L, 12L, 12L, 12L,
12L, 12L, 12L, 1L, 1L, 56L, 56L, 56L, 56L, 56L, 56L, 56L, 56L,
56L, 56L, 12L, 12L, 12L), .Label = c("Algeria", "Australia",
"Austria", "Beijing", "Belgium", "Brazil", "Cambodia", "Canada",
"Chile", "China", "Chongqing", "Congo", "CzechRepublic", "Denmark",
"England", "Finland", "Foshan", "France", "Fujian", "Georgia",
"Germany", "Greece", "Guangdong", "Guangzhou", "Hangzhou", "Hefei",
"HongKong", "Hungary", "Iceland", "Ireland", "Israel", "Italy",
"Japan", "Jiangsu", "Jiangxi", "Jingzhou", "Kuwait", "Lithuania",
"Luxembourg", "Malaysia", "Mexico", "NanChang", "NC_045512.2",
"Nepal", "Netherlands", "NewZealand", "Nonthaburi", "Norway",
"Pakistan", "Peru", "Poland", "Portugal", "Russia", "SaudiArabia",
"Scotland", "Senegal", "Shandong", "Shanghai", "Shenzhen", "Sichuan",
"Singapore", "Slovakia", "SouthAfrica", "SouthKorea", "Spain",
"Sweden", "Switzerland", "Taiwan", "Tianmen", "USA", "Vietnam",
"Wales", "Wuhan", "Wuhan-Hu-1", "Yunnan", "Zhejiang"), class = "factor"),
Continent = structure(c(2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L), .Label = c("Africa", "Asia", "Europe", "NorthAmerica",
"Oceania", "SouthAmerica"), class = "factor"), Country = structure(c(8L,
47L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 1L, 1L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 9L, 9L, 9L), .Label = c("Algeria",
"Australia", "Austria", "Belgium", "Brazil", "Canada", "Chile",
"China", "Congo", "CzechRepublic", "Denmark", "England",
"Europe", "Finland", "France", "Georgia", "Germany", "Greece",
"Hangzhou", "HongKong", "Hungary", "Iceland", "Ireland",
"Israel", "Italy", "Japan", "Kuwait", "Lithuania", "Luxembourg",
"Malaysia", "Mexico", "Nepal", "Netherlands", "NewZealand",
"Norway", "Pakistan", "Peru", "Poland", "Portugal", "Russia",
"SaudiArabia", "Scotland", "Senegal", "Shanghai", "Singapore",
"Slovakia", "SouthAfrica", "SouthKorea", "Spain", "Sweden",
"Switzerland", "Tailand", "Taiwan", "USA", "Vietnam"), class = "factor"),
col.names = structure(c(3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L,
3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L,
3L), .Label = c("Continent", "Country", "Population"), class = "factor")), row.names = c(NA,
25L), class = "data.frame")
有人可以帮忙吗
space