ggplot:使用包 RColorBrewer 填充箱线图 + 在 R 的 Cowplot 包中使用 plot_grid() 绘制箱线图
ggplot: Fill Boxplots Using the Package RColorBrewer + Plot Boxplots Using plot_grid() in the Cowplot Package in R
概览
我有一个名为 'ANOVA.Dataframe.1' 和 'ANOVA.Dataframe.2' 的两个数据框(见下文)。
对于这个项目,我有两个目标:
(1) 使用包 RColorBrewer;
填充箱线图
(2) 使用包 Cowplot
绘制箱线图
问题
首先,我生成了两个 objects,名为 New.filled.Boxplot。obs1.Canopy.Urban 和 New.filled.Boxplot.obs2.Canopy.Urban,我添加了函数 (即函数 1 或函数 2 - 请参阅下面的 R-code)通过以下 scale_fill_brewer(palette="Dark2") 包中的 scale_fill_brewer(palette="Dark2") 函数生成箱线图 example 以产生所需的结果。但是,我的代码不起作用 (见下图)。
当我使用 plot_grid() 在 Cowplot 包 中绘制箱线图时,定位标签标题(即 A:观察期 1 或 B:观察期 2 - 见下图)覆盖两个箱线图(见下图)。有没有一种方法可以操纵情节 window 中的绘图 space,使箱线图稍微小一些,而标签标题位于每个箱线图上方?
如果有人能提供帮助,我将不胜感激。
R-Code
library(tidyverse)
library(wrapr)
library(RColorBrewer)
library(dplyr)
# Open Colour Brewer Paletter Options
display.brewer.all()
## Function 1 to produce the boxplots for Dataframe 1
Boxplot.obs1.Canopy.Urban<-ANOVA.Dataframe.1 %.>%
ggplot(data = ., aes(
x = Urbanisation_index,
y = Canopy_Index,
group = Urbanisation_index,
)) +
stat_boxplot(
geom = 'errorbar',
width = .25
) +
geom_boxplot(notch=T) +
geom_line(
data = group_by(., Urbanisation_index) %>%
summarise(
bot = min(Canopy_Index),
top = max(Canopy_Index)
) %>%
gather(pos, val, bot:top) %>%
select(
x = Urbanisation_index,
y = val
) %>%
mutate(gr = row_number()) %>%
bind_rows(
tibble(
x = 0,
y = max(.$y) * 1.15,
gr = 1:8
)
),
aes(
x = x,
y = y,
group = gr
)) +
theme_light() +
theme(panel.grid = element_blank()) +
coord_cartesian(
xlim = c(min(.$Urbanisation_index) - .5, max(.$Urbanisation_index) + .5),
ylim = c(min(.$Canopy_Index) * .95, max(.$Canopy_Index) * 1.05)
) +
ylab('Company Index (%)') +
xlab('Urbanisation Index')
## Change the colours of the boxplot
New.filled.Boxplot.obs1.Canopy.Urban <- Boxplot.obs1.Canopy.Urban + scale_fill_brewer(palette="Dark2")
## Function 2 to produce the boxplots for Dataframe 2
Boxplot.obs2.Canopy.Urban<-ANOVA.Dataframe.2 %.>%
ggplot(data = ., aes(
x = Urbanisation_index,
y = Canopy_Index,
group = Urbanisation_index,
)) +
stat_boxplot(
geom = 'errorbar',
width = .25
) +
geom_boxplot(notch=T) +
geom_line(
data = group_by(., Urbanisation_index) %>%
summarise(
bot = min(Canopy_Index),
top = max(Canopy_Index)
) %>%
gather(pos, val, bot:top) %>%
select(
x = Urbanisation_index,
y = val
) %>%
mutate(gr = row_number()) %>%
bind_rows(
tibble(
x = 0,
y = max(.$y) * 1.15,
gr = 1:8
)
),
aes(
x = x,
y = y,
group = gr
)) +
theme_light() +
theme(panel.grid = element_blank()) +
coord_cartesian(
xlim = c(min(.$Urbanisation_index) - .5, max(.$Urbanisation_index) + .5),
ylim = c(min(.$Canopy_Index) * .95, max(.$Canopy_Index) * 1.05)
) +
ylab('Company Index (%)') +
xlab('Urbanisation Index')
## Change the colours of the boxplot
New.filled.Boxplot.obs2.Canopy.Urban<- Boxplot.obs2.Canopy.Urban + scale_fill_brewer(palette="Dark2")
library(cowplot)
## Open New plot window
dev.new()
Combined_boxplot_Obs<-plot_grid(New.filled.Boxplot.obs1.Canopy.Urban,
New.filled.Boxplot.obs2.Canopy.Urban,
labels=c("A: Observation Period 1",
"B: Observation Period 2"),
label_fontface="bold",
label_fontfamily="Times New Roman",
label_size=12,
align="v",
ncol=2, nrow=1)
Combined_boxplot_Obs
这个 R-code 产生了这些图:
数据框1
structure(list(Urbanisation_index = c(2, 2, 4, 4, 3, 3, 4, 4,
4, 2, 4, 3, 4, 4, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
2, 2, 2, 4, 4, 3, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 4, 4, 4,
4, 4, 4, 4), Canopy_Index = c(65, 75, 55, 85, 85, 85, 95, 85,
85, 45, 65, 75, 75, 65, 35, 75, 65, 85, 65, 95, 75, 75, 75, 65,
75, 65, 75, 95, 95, 85, 85, 85, 75, 75, 65, 85, 75, 65, 55, 95,
95, 95, 95, 45, 55, 35, 55, 65, 95, 95, 45, 65, 45, 55)), row.names = c(NA,
-54L), class = "data.frame")
数据帧 2
structure(list(Urbanisation_index = c(2, 2, 4, 4, 3, 3, 4, 4,
4, 3, 4, 4, 4, 4, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
2, 2, 2, 4, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 4, 4, 4, 4, 4, 4, 4
), Canopy_Index = c(5, 45, 5, 5, 5, 5, 45, 45, 55, 15, 35, 45,
5, 5, 5, 5, 5, 5, 35, 15, 15, 25, 25, 5, 5, 5, 5, 5, 5, 15, 25,
15, 35, 25, 45, 5, 25, 5, 5, 5, 5, 55, 55, 15, 5, 25, 15, 15,
15, 15)), row.names = c(NA, -50L), class = "data.frame")
scale_fill_brewer(palette = "Dark2")
在您的示例中不起作用,因为您没有提供 fill
-美学。您需要将其添加到您的箱线图中。
plot_grid
中的标签应该是单个字母(或至少是短字母)以供在标题中参考。为了您的目的,我建议在原始情节中使用标题。
- 您的代码很难阅读,您可以减少使用的包的数量。我还缩短了名称,因为它们在这里并不那么重要,并且使一切都更加冗长。
- 我不会在
ggplot
调用中计算特殊统计数据,而是在单独的 data.frame
调用之前计算。
套餐
library(tidyverse)
library(cowplot)
第一个箱线图
# Calculate special positions for lines first
mydf.1.lines <- mydf.1 %>%
group_by(Urbanisation) %>%
summarise(bot = min(Canopy), top = max(Canopy)) %>%
gather(pos, val, bot:top) %>%
select(x = Urbanisation, y = val) %>%
mutate(gr = row_number()) %>%
bind_rows(tibble(x = 0, y = max(.$y) * 1.15, gr = 1:8))
# Calculate plot limits
xlimits.1 <- with(mydf.1, c(min(Urbanisation) - .5, max(Urbanisation) + .5))
ylimits.1 <- with(mydf.1, c(min(Canopy) * .95, max(Canopy) * 1.05))
Boxplot.1 <-
ggplot(mydf.1, aes(Urbanisation, Canopy, group = Urbanisation)) +
stat_boxplot(geom = 'errorbar', width = .25) +
# Add a fill aesthetics in the geom_boxplot - call:
geom_boxplot(aes(fill = factor(Urbanisation)), notch = TRUE) +
geom_line(data = mydf.1.lines,
aes(x, y, group = gr)) +
theme_light() +
theme(panel.grid = element_blank()) +
coord_cartesian(xlim = xlimits.1, ylim = ylimits.1) +
ylab('Company Index (%)') +
xlab('Urbanisation Index')
New.filled.Boxplot.1 <- Boxplot.1 + scale_fill_brewer(palette = "Dark2")
第二个箱线图
类似于第一个:
mydf.2.lines <- mydf.2 %>%
group_by(Urbanisation) %>%
summarise(bot = min(Canopy), top = max(Canopy)) %>%
gather(pos, val, bot:top) %>%
select(x = Urbanisation, y = val) %>%
mutate(gr = row_number()) %>%
bind_rows(tibble(x = 0, y = max(.$y) * 1.15, gr = 1:8))
xlimits.2 <- with(mydf.2, c(min(Urbanisation) - .5, max(Urbanisation) + .5))
ylimits.2 <- with(mydf.2, c(min(Canopy) * .95, max(Canopy) * 1.05))
Boxplot.2 <-
ggplot(mydf.2, aes(Urbanisation, Canopy, group = Urbanisation)) +
stat_boxplot(geom = 'errorbar', width = .25) +
geom_boxplot(aes(fill = factor(Urbanisation)), notch = TRUE) +
geom_line(data = mydf.2.lines,
aes(x, y, group = gr)) +
theme_light() +
theme(panel.grid = element_blank()) +
coord_cartesian(xlim = xlimits.2, ylim = ylimits.2) +
ylab('Company Index (%)') +
xlab('Urbanisation Index')
New.filled.Boxplot.2 <- Boxplot.2 + scale_fill_brewer(palette = "Dark2")
合并地块
plot_grid(New.filled.Boxplot.1 + ggtitle("A: Observation Period 1"),
New.filled.Boxplot.2 + ggtitle("B: Observation Period 2"),
align = "v",
ncol = 2,
nrow = 1)
或者使用正确的标题规范和 hjust(感谢 Claus Wilke):
plot_grid(New.filled.Boxplot.1 + ggtitle(""),
New.filled.Boxplot.2 + ggtitle(""),
align = "v",
labels = c("A: Observation Period 1", "B: Observation Period 2"),
hjust = 0,
label_x = 0.01,
ncol = 2,
nrow = 1)
图外的箱线图
这里的问题是槽口在铰链外面。如果您为第二个情节(或两者)设置 notch = FALSE
,那没问题。或者,您也可以按照您已经建议的那样操纵 ylimits 。函数 with
仅指定 data.frame
(mydf.2),其中可以找到以下列。因此调用
ylimits.2 <- with(mydf.2, c(min(Canopy) * .95, max(Canopy) * 1.05))
等同于
ylimits.2 <- c(min(mydf.2$Canopy) * .95, max(mydf.2$Canopy) * 1.05)
你可以指定
ylimits.2 <- c(-20, max(mydf.2$Canopy) * 1.05)
这会将下限设置为 -20,将上限设置为第二个数据帧中 Canopy 索引最大值的 1.05 倍。
数据
mydf.1 <-
structure(list(Urbanisation = c(2, 2, 4, 4, 3, 3, 4, 4, 4, 2, 4, 3, 4, 4, 1,
1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2, 2, 4, 4, 3, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2,
2, 1, 4, 4, 4, 4, 4, 4, 4),
Canopy = c(65, 75, 55, 85, 85, 85, 95, 85, 85, 45, 65, 75, 75,
65, 35, 75, 65, 85, 65, 95, 75, 75, 75, 65, 75, 65,
75, 95, 95, 85, 85, 85, 75, 75, 65, 85, 75, 65, 55,
95, 95, 95, 95, 45, 55, 35, 55, 65, 95, 95, 45, 65,
45, 55)),
row.names = c(NA, -54L), class = "data.frame")
mydf.2 <-
structure(list(Urbanisation = c(2, 2, 4, 4, 3, 3, 4, 4, 4, 3, 4, 4, 4, 4, 1,
1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2, 2, 4, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 4, 4,
4, 4, 4, 4, 4),
Canopy = c(5, 45, 5, 5, 5, 5, 45, 45, 55, 15, 35, 45, 5, 5, 5,
5, 5, 5, 35, 15, 15, 25, 25, 5, 5, 5, 5, 5, 5, 15,
25, 15, 35, 25, 45, 5, 25, 5, 5, 5, 5, 55, 55, 15,
5, 25, 15, 15, 15, 15)),
row.names = c(NA, -50L), class = "data.frame")
概览
我有一个名为 'ANOVA.Dataframe.1' 和 'ANOVA.Dataframe.2' 的两个数据框(见下文)。
对于这个项目,我有两个目标:
(1) 使用包 RColorBrewer;
填充箱线图(2) 使用包 Cowplot
绘制箱线图问题
首先,我生成了两个 objects,名为 New.filled.Boxplot。obs1.Canopy.Urban 和 New.filled.Boxplot.obs2.Canopy.Urban,我添加了函数 (即函数 1 或函数 2 - 请参阅下面的 R-code)通过以下 scale_fill_brewer(palette="Dark2") 包中的 scale_fill_brewer(palette="Dark2") 函数生成箱线图 example 以产生所需的结果。但是,我的代码不起作用 (见下图)。
当我使用 plot_grid() 在 Cowplot 包 中绘制箱线图时,定位标签标题(即 A:观察期 1 或 B:观察期 2 - 见下图)覆盖两个箱线图(见下图)。有没有一种方法可以操纵情节 window 中的绘图 space,使箱线图稍微小一些,而标签标题位于每个箱线图上方?
如果有人能提供帮助,我将不胜感激。
R-Code
library(tidyverse)
library(wrapr)
library(RColorBrewer)
library(dplyr)
# Open Colour Brewer Paletter Options
display.brewer.all()
## Function 1 to produce the boxplots for Dataframe 1
Boxplot.obs1.Canopy.Urban<-ANOVA.Dataframe.1 %.>%
ggplot(data = ., aes(
x = Urbanisation_index,
y = Canopy_Index,
group = Urbanisation_index,
)) +
stat_boxplot(
geom = 'errorbar',
width = .25
) +
geom_boxplot(notch=T) +
geom_line(
data = group_by(., Urbanisation_index) %>%
summarise(
bot = min(Canopy_Index),
top = max(Canopy_Index)
) %>%
gather(pos, val, bot:top) %>%
select(
x = Urbanisation_index,
y = val
) %>%
mutate(gr = row_number()) %>%
bind_rows(
tibble(
x = 0,
y = max(.$y) * 1.15,
gr = 1:8
)
),
aes(
x = x,
y = y,
group = gr
)) +
theme_light() +
theme(panel.grid = element_blank()) +
coord_cartesian(
xlim = c(min(.$Urbanisation_index) - .5, max(.$Urbanisation_index) + .5),
ylim = c(min(.$Canopy_Index) * .95, max(.$Canopy_Index) * 1.05)
) +
ylab('Company Index (%)') +
xlab('Urbanisation Index')
## Change the colours of the boxplot
New.filled.Boxplot.obs1.Canopy.Urban <- Boxplot.obs1.Canopy.Urban + scale_fill_brewer(palette="Dark2")
## Function 2 to produce the boxplots for Dataframe 2
Boxplot.obs2.Canopy.Urban<-ANOVA.Dataframe.2 %.>%
ggplot(data = ., aes(
x = Urbanisation_index,
y = Canopy_Index,
group = Urbanisation_index,
)) +
stat_boxplot(
geom = 'errorbar',
width = .25
) +
geom_boxplot(notch=T) +
geom_line(
data = group_by(., Urbanisation_index) %>%
summarise(
bot = min(Canopy_Index),
top = max(Canopy_Index)
) %>%
gather(pos, val, bot:top) %>%
select(
x = Urbanisation_index,
y = val
) %>%
mutate(gr = row_number()) %>%
bind_rows(
tibble(
x = 0,
y = max(.$y) * 1.15,
gr = 1:8
)
),
aes(
x = x,
y = y,
group = gr
)) +
theme_light() +
theme(panel.grid = element_blank()) +
coord_cartesian(
xlim = c(min(.$Urbanisation_index) - .5, max(.$Urbanisation_index) + .5),
ylim = c(min(.$Canopy_Index) * .95, max(.$Canopy_Index) * 1.05)
) +
ylab('Company Index (%)') +
xlab('Urbanisation Index')
## Change the colours of the boxplot
New.filled.Boxplot.obs2.Canopy.Urban<- Boxplot.obs2.Canopy.Urban + scale_fill_brewer(palette="Dark2")
library(cowplot)
## Open New plot window
dev.new()
Combined_boxplot_Obs<-plot_grid(New.filled.Boxplot.obs1.Canopy.Urban,
New.filled.Boxplot.obs2.Canopy.Urban,
labels=c("A: Observation Period 1",
"B: Observation Period 2"),
label_fontface="bold",
label_fontfamily="Times New Roman",
label_size=12,
align="v",
ncol=2, nrow=1)
Combined_boxplot_Obs
这个 R-code 产生了这些图:
数据框1
structure(list(Urbanisation_index = c(2, 2, 4, 4, 3, 3, 4, 4,
4, 2, 4, 3, 4, 4, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
2, 2, 2, 4, 4, 3, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 4, 4, 4,
4, 4, 4, 4), Canopy_Index = c(65, 75, 55, 85, 85, 85, 95, 85,
85, 45, 65, 75, 75, 65, 35, 75, 65, 85, 65, 95, 75, 75, 75, 65,
75, 65, 75, 95, 95, 85, 85, 85, 75, 75, 65, 85, 75, 65, 55, 95,
95, 95, 95, 45, 55, 35, 55, 65, 95, 95, 45, 65, 45, 55)), row.names = c(NA,
-54L), class = "data.frame")
数据帧 2
structure(list(Urbanisation_index = c(2, 2, 4, 4, 3, 3, 4, 4,
4, 3, 4, 4, 4, 4, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
2, 2, 2, 4, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 4, 4, 4, 4, 4, 4, 4
), Canopy_Index = c(5, 45, 5, 5, 5, 5, 45, 45, 55, 15, 35, 45,
5, 5, 5, 5, 5, 5, 35, 15, 15, 25, 25, 5, 5, 5, 5, 5, 5, 15, 25,
15, 35, 25, 45, 5, 25, 5, 5, 5, 5, 55, 55, 15, 5, 25, 15, 15,
15, 15)), row.names = c(NA, -50L), class = "data.frame")
scale_fill_brewer(palette = "Dark2")
在您的示例中不起作用,因为您没有提供fill
-美学。您需要将其添加到您的箱线图中。plot_grid
中的标签应该是单个字母(或至少是短字母)以供在标题中参考。为了您的目的,我建议在原始情节中使用标题。- 您的代码很难阅读,您可以减少使用的包的数量。我还缩短了名称,因为它们在这里并不那么重要,并且使一切都更加冗长。
- 我不会在
ggplot
调用中计算特殊统计数据,而是在单独的data.frame
调用之前计算。
套餐
library(tidyverse)
library(cowplot)
第一个箱线图
# Calculate special positions for lines first
mydf.1.lines <- mydf.1 %>%
group_by(Urbanisation) %>%
summarise(bot = min(Canopy), top = max(Canopy)) %>%
gather(pos, val, bot:top) %>%
select(x = Urbanisation, y = val) %>%
mutate(gr = row_number()) %>%
bind_rows(tibble(x = 0, y = max(.$y) * 1.15, gr = 1:8))
# Calculate plot limits
xlimits.1 <- with(mydf.1, c(min(Urbanisation) - .5, max(Urbanisation) + .5))
ylimits.1 <- with(mydf.1, c(min(Canopy) * .95, max(Canopy) * 1.05))
Boxplot.1 <-
ggplot(mydf.1, aes(Urbanisation, Canopy, group = Urbanisation)) +
stat_boxplot(geom = 'errorbar', width = .25) +
# Add a fill aesthetics in the geom_boxplot - call:
geom_boxplot(aes(fill = factor(Urbanisation)), notch = TRUE) +
geom_line(data = mydf.1.lines,
aes(x, y, group = gr)) +
theme_light() +
theme(panel.grid = element_blank()) +
coord_cartesian(xlim = xlimits.1, ylim = ylimits.1) +
ylab('Company Index (%)') +
xlab('Urbanisation Index')
New.filled.Boxplot.1 <- Boxplot.1 + scale_fill_brewer(palette = "Dark2")
第二个箱线图
类似于第一个:
mydf.2.lines <- mydf.2 %>%
group_by(Urbanisation) %>%
summarise(bot = min(Canopy), top = max(Canopy)) %>%
gather(pos, val, bot:top) %>%
select(x = Urbanisation, y = val) %>%
mutate(gr = row_number()) %>%
bind_rows(tibble(x = 0, y = max(.$y) * 1.15, gr = 1:8))
xlimits.2 <- with(mydf.2, c(min(Urbanisation) - .5, max(Urbanisation) + .5))
ylimits.2 <- with(mydf.2, c(min(Canopy) * .95, max(Canopy) * 1.05))
Boxplot.2 <-
ggplot(mydf.2, aes(Urbanisation, Canopy, group = Urbanisation)) +
stat_boxplot(geom = 'errorbar', width = .25) +
geom_boxplot(aes(fill = factor(Urbanisation)), notch = TRUE) +
geom_line(data = mydf.2.lines,
aes(x, y, group = gr)) +
theme_light() +
theme(panel.grid = element_blank()) +
coord_cartesian(xlim = xlimits.2, ylim = ylimits.2) +
ylab('Company Index (%)') +
xlab('Urbanisation Index')
New.filled.Boxplot.2 <- Boxplot.2 + scale_fill_brewer(palette = "Dark2")
合并地块
plot_grid(New.filled.Boxplot.1 + ggtitle("A: Observation Period 1"),
New.filled.Boxplot.2 + ggtitle("B: Observation Period 2"),
align = "v",
ncol = 2,
nrow = 1)
或者使用正确的标题规范和 hjust(感谢 Claus Wilke):
plot_grid(New.filled.Boxplot.1 + ggtitle(""),
New.filled.Boxplot.2 + ggtitle(""),
align = "v",
labels = c("A: Observation Period 1", "B: Observation Period 2"),
hjust = 0,
label_x = 0.01,
ncol = 2,
nrow = 1)
图外的箱线图
这里的问题是槽口在铰链外面。如果您为第二个情节(或两者)设置 notch = FALSE
,那没问题。或者,您也可以按照您已经建议的那样操纵 ylimits 。函数 with
仅指定 data.frame
(mydf.2),其中可以找到以下列。因此调用
ylimits.2 <- with(mydf.2, c(min(Canopy) * .95, max(Canopy) * 1.05))
等同于
ylimits.2 <- c(min(mydf.2$Canopy) * .95, max(mydf.2$Canopy) * 1.05)
你可以指定
ylimits.2 <- c(-20, max(mydf.2$Canopy) * 1.05)
这会将下限设置为 -20,将上限设置为第二个数据帧中 Canopy 索引最大值的 1.05 倍。
数据
mydf.1 <-
structure(list(Urbanisation = c(2, 2, 4, 4, 3, 3, 4, 4, 4, 2, 4, 3, 4, 4, 1,
1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2, 2, 4, 4, 3, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2,
2, 1, 4, 4, 4, 4, 4, 4, 4),
Canopy = c(65, 75, 55, 85, 85, 85, 95, 85, 85, 45, 65, 75, 75,
65, 35, 75, 65, 85, 65, 95, 75, 75, 75, 65, 75, 65,
75, 95, 95, 85, 85, 85, 75, 75, 65, 85, 75, 65, 55,
95, 95, 95, 95, 45, 55, 35, 55, 65, 95, 95, 45, 65,
45, 55)),
row.names = c(NA, -54L), class = "data.frame")
mydf.2 <-
structure(list(Urbanisation = c(2, 2, 4, 4, 3, 3, 4, 4, 4, 3, 4, 4, 4, 4, 1,
1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2, 2, 4, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 4, 4,
4, 4, 4, 4, 4),
Canopy = c(5, 45, 5, 5, 5, 5, 45, 45, 55, 15, 35, 45, 5, 5, 5,
5, 5, 5, 35, 15, 15, 25, 25, 5, 5, 5, 5, 5, 5, 15,
25, 15, 35, 25, 45, 5, 25, 5, 5, 5, 5, 55, 55, 15,
5, 25, 15, 15, 15, 15)),
row.names = c(NA, -50L), class = "data.frame")