nicholasehamilton / ggtern

Extension to ggplot2 for plotting ternary diagrams
www.ggtern.com
55 stars 14 forks source link

ggtern will not run with the latest ggplot2 #49

Open Knighty16 opened 3 years ago

Knighty16 commented 3 years ago

There seems to be an issue with ggtern running with the new ggplot2. I have tried to load earlier versions of R, ggtern, and ggplot2 but cannot get them working. With the latest versions I get the following error:

Error: geom_point requires the following missing aesthetics: x and y

rlang::last_error() <error/rlang_error> geom_point requires the following missing aesthetics: x and y Backtrace:

  1. (function (x, ...) ...
  2. ggtern:::print.ggplot(x)
  3. ggtern:::ggplot_build.ggplot(x)
  4. ggtern:::by_layer(function(l, d) l$compute_geom_1(d))
  5. ggtern:::f(l = layers[[i]], d = data[[i]])
  6. l$compute_geom_1(d)
  7. ggplot2:::f(..., self = self)
  8. ggplot2:::check_required_aesthetics(...)

rlang::last_trace() <error/rlang_error> geom_point requires the following missing aesthetics: x and y Backtrace: x

  1. +-(function (x, ...) ...
  2. -ggtern:::print.ggplot(x)
  3. +-ggtern::ggplot_build(x)
  4. -ggtern:::ggplot_build.ggplot(x)
  5. -ggtern:::by_layer(function(l, d) l$compute_geom_1(d))
  6. -ggtern:::f(l = layers[[i]], d = data[[i]])
  7. -l$compute_geom_1(d)
  8. -ggplot2:::f(..., self = self)
  9. -ggplot2:::check_required_aesthetics(...)
MichalisOmirou commented 3 years ago

I am facing exactly the same issue while I am trying to correct a plot that I have already generated using previous versions of ggplot2.

packageVersion('ggplot2') [1] ‘3.3.5’

packageVersion('ggtern') [1] ‘3.3.0’

The following are appeared:

Error: geom_point requires the following missing aesthetics: x and y Run rlang::last_error() to see where the error occurred.

rlang::last_error() <error/rlang_error> geom_point requires the following missing aesthetics: x and y Backtrace:

  1. (function (x, ...) ...
  2. ggtern:::print.ggplot(x)
  3. ggtern:::ggplot_build.ggplot(x)
  4. ggtern:::by_layer(function(l, d) l$compute_geom_1(d))
  5. ggtern:::f(l = layers[[i]], d = data[[i]])
  6. l$compute_geom_1(d)
  7. ggplot2:::f(..., self = self)
  8. ggplot2:::check_required_aesthetics(...)

geom_point requires the following missing aesthetics: x and y Backtrace: █

  1. ├─(function (x, ...) ...
  2. └─ggtern:::print.ggplot(x)
  3. ├─ggtern::ggplot_build(x)
  4. └─ggtern:::ggplot_build.ggplot(x)
  5. └─ggtern:::by_layer(function(l, d) l$compute_geom_1(d))
  6. └─ggtern:::f(l = layers[[i]], d = data[[i]])
  7. └─l$compute_geom_1(d)
  8. └─ggplot2:::f(..., self = self)
  9. └─ggplot2:::check_required_aesthetics(...)
loukesio commented 3 years ago

Same error for me

Knighty16 commented 3 years ago

I found the version combinations to get ggtern working again is:

reload:

R 4.0.2 ggplot2: 3.3.2 ggtern: 3.3.0 - ignore the warning...

Kind regards

Knighty16