Import data

# excel file
data <- read_excel("./data/palmtrees_apply2.xlsx")
data
## # A tibble: 2,557 × 29
##    spec_name            acc_genus acc_species palm_tribe palm_subfamily climbing
##    <chr>                <chr>     <chr>       <chr>      <chr>          <chr>   
##  1 Acanthophoenix crin… Acanthop… crinita     Areceae    Arecoideae     climbing
##  2 Acanthophoenix rous… Acanthop… rousselii   Areceae    Arecoideae     climbing
##  3 Acanthophoenix rubra Acanthop… rubra       Areceae    Arecoideae     climbing
##  4 Acoelorrhaphe wrigh… Acoelorr… wrightii    Trachycar… Coryphoideae   climbing
##  5 Acrocomia aculeata   Acrocomia aculeata    Cocoseae   Arecoideae     climbing
##  6 Acrocomia crispa     Acrocomia crispa      Cocoseae   Arecoideae     climbing
##  7 Acrocomia emensis    Acrocomia emensis     Cocoseae   Arecoideae     climbing
##  8 Acrocomia glaucesce… Acrocomia glaucescens Cocoseae   Arecoideae     climbing
##  9 Acrocomia hassleri   Acrocomia hassleri    Cocoseae   Arecoideae     climbing
## 10 Acrocomia intumesce… Acrocomia intumescens Cocoseae   Arecoideae     climbing
## # ℹ 2,547 more rows
## # ℹ 23 more variables: acaulescent <chr>, erect <chr>, stem_solitary <chr>,
## #   stem_armed <chr>, leaves_armed <chr>, max_stem_height_m <chr>,
## #   max_stem_dia_cm <chr>, understorey_canopy <chr>, max_leaf_number <chr>,
## #   max__blade__length_m <chr>, max__rachis__length_m <chr>,
## #   max__petiole_length_m <chr>, average_fruit_length_cm <chr>,
## #   min_fruit_length_cm <chr>, max_fruit_length_cm <chr>, …
data$max_stem_dia_cm <- as.numeric(data$max_stem_dia_cm)
data$fruit_size_categorical <- factor(
  data$fruit_size_categorical,
  levels = c("small", "medium", "large")
)

State one question

Do trees with wider stems tend to also have larger fruit?

Plot data

ggplot(data = data) +
  geom_jitter(mapping = aes(y=max_stem_dia_cm, x=fruit_size_categorical)) +
  scale_y_continuous(labels = scales::label_number(accuracy = 0.05))

Interpret

The data shows that there are many small fruited trees with small stem diameters, and only a few large fruited trees with small stem diameters. Because the large fruited trees have a similar distribution of stem diameters (apart from the small diameters) to the small fruited ones, we can conclude that larger stemmed trees tend to have larger fruits.