Check size more carefully before calling `compact_rep()` in all places, error on long sizes
PetiteTong opened this issue · comments
data_long
A tibble: 879,802,446 × 22
refu sd_bio1 sd_bio2 sd_bio3 sd_bio4 sd_bio5 sd_bio6 sd_bio7 sd_bio8
1 0 2.73 0.304 16.9 0.411 2.95 2.74 0.992 2.75
2 0 2.73 0.304 16.9 0.411 2.95 2.74 0.992 2.75
3 0 2.73 0.304 16.9 0.411 2.95 2.74 0.992 2.75
4 0 2.73 0.304 16.9 0.411 2.95 2.74 0.992 2.75
5 0 2.73 0.304 16.9 0.411 2.95 2.74 0.992 2.75
6 0 2.73 0.304 16.9 0.411 2.95 2.74 0.992 2.75
7 0 2.73 0.308 16.9 0.414 2.95 2.73 0.977 2.74
8 0 2.73 0.308 16.9 0.414 2.95 2.73 0.977 2.74
9 0 2.73 0.308 16.9 0.414 2.95 2.73 0.977 2.74
10 0 2.73 0.308 16.9 0.414 2.95 2.73 0.977 2.74
ℹ 879,802,436 more rows
ℹ 13 more variables: sd_bio9 , sd_bio10 , sd_bio11 ,
sd_bio12 , sd_bio13 , sd_bio14 , sd_bio15 ,
sd_bio16 , sd_bio17 , sd_bio18 , sd_bio19 ,
Variable , Value
ℹ Use print(n = ...)
to see more rows
创建小提琴图和箱图,并添加渐变色
p <- ggplot(data_long, aes(x = refu, y = Value, fill = refu)) +
- geom_violin() +
- geom_boxplot(width = 0.2, position = position_dodge(0.75)) +
- facet_wrap(~ Variable, scales = "free_y", ncol = 2) +
- labs(x = "refu", y = "Value") +
- scale_fill_manual(values = c('1' = "pink", '0' = "blue")) + # 手动指定颜色
- theme_minimal()
打印小提琴图和箱图
print(p)
Error invec_rbind()
:
! Negativen
incompact_rep()
.
ℹ In file utils.c at line 897.
ℹ Install the winch package to get additional debugging info the next time you get this error.
ℹ This is an internal error that was detected in the vctrs package.
Please report it at https://github.com/r-lib/vctrs/issues with a reprex (https://tidyverse.org/help/) and the full backtrace.
Backtrace:
▆
- ├─base::print(p)
- ├─base::print(p)
- ├─ggplot2:::print.ggplot(p)
- │ ├─ggplot2::ggplot_build(x)
- │ └─ggplot2:::ggplot_build.ggplot(x)
- │ └─layout$setup(data, plot$data, plot$plot_env)
- │ └─ggplot2 (local) setup(..., self = self)
- │ └─self$facet$compute_layout(data, self$facet_params)
- │ └─ggplot2 (local) compute_layout(..., self = self)
- │ └─ggplot2::combine_vars(data, params$plot_env, vars, drop = params$drop)
- │ ├─ggplot2:::unique0(vec_rbind0(!!!values[has_all]))
- │ └─ggplot2:::vec_rbind0(!!!values[has_all])
- │ ├─ggplot2:::with_ordered_restart(...)
- │ │ └─base::withCallingHandlers(...)
- │ └─vctrs::vec_rbind(..., .error_call = .error_call)
- └─rlang:::stop_internal_c_lib(...)
- └─rlang::abort(message, call = call, .internal = TRUE, .frame = frame)