MixSIAR icon indicating copy to clipboard operation
MixSIAR copied to clipboard

Error message for plotting isospace

Open EmmiKurosawa opened this issue 1 year ago • 0 comments

I cannot plot isospace due to an error message which has something to do with the aesthetics of ggplot. Please help!

tef_05May2023.csv [source_PW_SpDi_05May2023.csv]

(https://github.com/brianstock/MixSIAR/files/11409955/source_PW_SpDi_05May2023.csv)

mix_EH_Sp_05May2023.csv

The error messages is:

plot_data(filename="isopace_PW_Sp_05May2023", plot_save_pdf=TRUE,

  •       plot_save_png=TRUE, mix,source,discr)
    

Error in ggplot2::geom_pointrange(): ! Problem while setting up geom aesthetics. ℹ Error occurred in the 2nd layer. Caused by error in check_aesthetics(): ! Aesthetics must be either length 1 or the same as the data (15) ✖ Fix the following mappings: linetype Run rlang::last_trace() to see where the error occurred.

rlang::last_trace() <error/rlang_error> Error in ggplot2::geom_pointrange(): ! Problem while setting up geom aesthetics. ℹ Error occurred in the 2nd layer. Caused by error in check_aesthetics(): ! Aesthetics must be either length 1 or the same as the data (15) ✖ Fix the following mappings: linetype


Backtrace: ▆

  1. └─MixSIAR::plot_data(...)
  2. └─MixSIAR::plot_data_two_iso(...)
  3. ├─base::print(g)
    
  4. └─ggplot2:::print.ggplot(g)
    
  5.   ├─ggplot2::ggplot_build(x)
    
  6.   └─ggplot2:::ggplot_build.ggplot(x)
    
  7.     └─ggplot2:::by_layer(...)
    
  8.       ├─rlang::try_fetch(...)
    
  9.       │ ├─base::tryCatch(...)
    
  10.       │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
    
  11.       │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
    
  12.       │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
    
  13.       │ └─base::withCallingHandlers(...)
    
  14.       └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
    
  15.         └─l$compute_geom_2(d)
    
  16.           └─ggplot2 (local) compute_geom_2(..., self = self)
    
  17.             └─self$geom$use_defaults(data, self$aes_params, modifiers)
    
  18.               └─ggplot2 (local) use_defaults(..., self = self)
    
  19.                 └─ggplot2:::check_aesthetics(params[aes_params], nrow(data))
    

EmmiKurosawa avatar May 05 '23 20:05 EmmiKurosawa