leombastos / 2024_ppa

1 stars 5 forks source link

facing issue running this code #64

Closed KVUGA closed 5 months ago

KVUGA commented 5 months ago

zone_s_df %>% dplyr::select(-stclass) %>% pivot_longer(cols = elev_m:eca90_dsm) %>% ggplot(aes(x=cluster_f, y=value, color=cluster_f))+ geom_boxplot(show.legend = F)+ scale_color_colorblind()+ facet_wrap(~name, scales="free_y", ncol=3)+ stat_compare_means(label = "p.format", hjust = -.1, vjust=1)+ theme(legend.position = "none")

Error in geom_boxplot(): ! Problem while computing stat. ℹ Error occurred in the 1st layer. Caused by error in seq_len(): ! argument must be coercible to non-negative integer Backtrace:

  1. base (local) <fn>(x)
  2. ggplot2:::print.ggplot(x)
  3. ggplot2:::ggplot_build.ggplot(x)
  4. ggplot2:::by_layer(...)
    1. ggplot2 (local) f(l = layers[[i]], d = data[[i]]) ...
    2. ggplot2 (local) compute_statistic(..., self = self)
    3. self$stat$compute_layer(data, self$computed_stat_params, layout)
    4. ggplot2 (local) compute_layer(..., self = self)
    5. ggplot2:::dapply(...)
    6. ggplot2:::split_with_index(seq_len(nrow(df)), ids) Error in geom_boxplot(show.legend = F) : ℹ Error occurred in the 1st layer. Caused by error in seq_len(): ! argument must be coercible to non-negative integer