EvaYiwenWang / PLSDAbatch_workflow

17 stars 8 forks source link

Error in Scatter_Density #6

Closed StickHu closed 1 year ago

StickHu commented 1 year ago

Hi Eva,

I am trying to plot a Scatter_Density. I have collected more than 8 datasets and wanted to use this to adjust data for the batch correction. I have followed the format of your datasets. But there were some mistakes remaining. Hope you can help!

Thanks Stick Hu

colorlist <- paletteer_dynamic("cartography::multi.pal", 20) length(colorlist) [1] 20 Scatter_Density(object = df_pca_before, batch = df_batch, trt = df_trt, color.set = colorlist[1:8]) Error in palette(): ! Insufficient values in manual scale. 8 needed but only 5 provided. Run rlang::last_trace() to see where the error occurred. rlang::last_trace() <error/rlang_error> Error in palette(): ! Insufficient values in manual scale. 8 needed but only 5 provided.

Backtrace: ▆

  1. └─PLSDAbatch::Scatter_Density(...)
  2. └─ggplot2::layer_scales(pMain)
  3. ├─ggplot2::ggplot_build(plot)
  4. └─ggplot2:::ggplot_build.ggplot(plot)
  5. └─base::lapply(data, scales_map_df, scales = npscales)
  6. └─ggplot2 (local) FUN(X[[i]], ...)
  7. ├─base::unlist(...)
  8. └─base::lapply(scales$scales, function(scale) scale$map_df(df = df))
  9. └─ggplot2 (local) FUN(X[[i]], ...)
  10. └─scale$map_df(df = df)
  11. └─ggplot2 (local) map_df(..., self = self)
  12. └─base::lapply(aesthetics, function(j) self$map(df[[j]]))
  13. └─ggplot2 (local) FUN(X[[i]], ...)
  14. └─self$map(df[[j]])
  15. └─ggplot2 (local) map(..., self = self)
  16. └─self$palette(n)
  17. └─ggplot2 (local) palette(...) Run rlang::last_trace(drop = FALSE) to see 2 hidden frames.
EvaYiwenWang commented 1 year ago

Hello Stick,

Sorry for the late reply. May I have your data so I can have a try?

Best regards, Eva

On Jun 19, 2023, at 17:26, StickHu @.***> wrote:

colorlist <- paletteer_dynamic("cartography::multi.pal", 20)

StickHu commented 1 year ago

Hello Eva,

The data is a little big. How can I send the data to you? Besides, I have other questions to ask you. Besides GitHub, is there any other way to contact you?

Best, StickHu

EvaYiwenWang commented 1 year ago

Hello Stick,

Maybe just send me a sample dataset? Feel free to contact me through my email: wangyiwen@caas.cn.

Best, Eva

StickHu commented 1 year ago

Hi Eva,

I have sent you the dataset through email. Hope you will write to me when you are free. Thanks.

Best, StickHu