Hi there,
I have problems with the ggpairs() function throwing an error even after checking for NA and odd data column names:
library(ggplot2)
library(GGally)
ggpairs(data = dat_pair)
Error in geom_text()
:
! Problem while computing aesthetics.
Error occurred in the 1st layer.
Caused by error:
! object 'X' not found
Backtrace:
▆
- ├─base (local)
<fn>
(x) - ├─GGally:::print.ggmatrix(x)
- │ └─GGally::ggmatrix_gtable(x, ...)
- │ └─GGally:::plot_gtable(p)
- │ ├─ggplot2::ggplot_gtable(ggplot_build(p))
- │ │ └─ggplot2:::attach_plot_env(data$plot$plot_env)
- │ │ └─base::options(ggplot2_plot_env = env)
- │ ├─ggplot2::ggplot_build(p)
- │ └─ggplot2:::ggplot_build.ggplot(p)
- │ └─ggplot2:::by_layer(...)
- │ ├─rlang::try_fetch(...)
- │ │ ├─base::tryCatch(...)
- │ │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
- │ │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
- │ │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
- │ │ └─base::withCallingHandlers(...)
- │ └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
- │ └─l$compute_aesthetics(d, plot)
- │ └─ggplot2 (local) compute_aesthetics(..., self = self)
- │ └─base::lapply(aesthetics, eval_tidy, data = data, env = env)
- │ └─rlang (local) FUN(X[[i]], ...)
- └─base::.handleSimpleError(
<fn>
, "object 'X' not found", base::quote(NULL)) - └─rlang (local) h(simpleError(msg, call))
-
└─handlers[[1L]](cnd)
-
└─cli::cli_abort(...)
-
└─rlang::abort(...)
dat_pair:
elevation | heatload | prec8110 |
---|---|---|
1.1051899 | 0.359055429 | 0.387516232 |
0.956123151 | 0.292817942 | 0.387516232 |
-0.053935174 | 0.011003425 | -1.27063566 |
0.089991802 | -1.035927267 | -0.222119661 |
0.123403071 | 0.171910421 | -0.055813353 |
0.619436259 | -0.059858997 | -0.031484173 |
-0.719596556 | 0.238772245 | -1.517715403 |
0.118262514 | 1.667634597 | -0.182204814 |
0.503780779 | -0.474286454 | -1.063257033 |
0.064290584 | 0.265676869 | -1.063257033 |
0.064290584 | 0.265676869 | -1.063257033 |
1.218274318 | -0.053980274 | -0.002525092 |
-2.079191599 | -0.838244689 | -1.41945956 |
-0.549969146 | 1.802826185 | -0.253426075 |
0.956123151 | -0.58640957 | -0.031484173 |
What could be causing the problem?