leonardojo / ggPlantmap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

! `ROI.id` must be size 0 or 1, not 2.

anthony-aylward opened this issue · comments

Describe the bug
Cannot load XML with XML.to.ggPlantmap(). The following error occurs:

Error in `dplyr::mutate()`:
ℹ In argument: `ROI.id = seq(1, length(unique(final.ROI$id)))`.
Caused by error:
! `ROI.id` must be size 0 or 1, not 2.
Run `rlang::last_trace()` to see where the error occurred.
Warning message:
Unknown or uninitialised column: `id`. 

The backtrace from rlang::last_trace():

Backtrace:
     ▆
  1. ├─ggPlantmap::XML.to.ggPlantmap("soy-root-image.png.xml")
  2. │ └─... %>% dplyr::select(ROI.name, ROI.id, point, x, y)
  3. ├─dplyr::select(., ROI.name, ROI.id, point, x, y)
  4. ├─dplyr::arrange(., ROI.id, point)
  5. ├─base::merge(., final.ROI, by = "id")
  6. ├─dplyr::mutate(., ROI.id = seq(1, length(unique(final.ROI$id))))
  7. ├─dplyr:::mutate.data.frame(., ROI.id = seq(1, length(unique(final.ROI$id))))
  8. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  9. │   ├─base::withCallingHandlers(...)
 10. │   └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
 11. │     └─mask$eval_all_mutate(quo)
 12. │       └─dplyr (local) eval()
 13. ├─dplyr:::dplyr_internal_error(...)
 14. │ └─rlang::abort(class = c(class, "dplyr:::internal_error"), dplyr_error_data = data)
 15. │   └─rlang:::signal_abort(cnd, .file)
 16. │     └─base::signalCondition(cnd)
 17. └─dplyr (local) `<fn>`(`<dpl:::__>`)
 18.   └─rlang::abort(message, class = error_class, parent = parent, call = error_call)

Any idea what might cause this?

To Reproduce
XML.to.ggPlantmap("filename")

Expected behavior
The XML file loads into a ggPlantmap

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS

Hello,
Thank you for the issue report,
It seems that your XML file is missing the id column,
Would you mind sending me your .XML file to jo.leonardo85@gmail.com?
Also, would you mind sending me the version of ICY you used to generate the xml file?
Thanks!

Thanks, it was indeed a problem with the specific XML file. I got things working with a different file and now the package is doing what I need, so I'll close the issue.