0

I am trying to convert a .XML file to excel using the R XML library. However, I am getting an error that I can not decode.

kindly assist to decode the error. Yes, I am an amateur in programming. But here is my code and the error

> library(XML)
> mydata <- xmlParse("2021-11-29-alp_gene_3.xml")
> mydata1 <- xmlToList(mydata)
> mydata3 <- do.call(rbind.data.frame, mydata1)
Error in (
  function (..., 
            deparse.level = 1, 
            make.row.names = TRUE, 
            stringsAsFactors = FALSE,  : 
            invalid list argument: all variables should have the same length
Tommy Grovnes
  • 4,126
  • 2
  • 25
  • 40
  • I assume your list elements don't have the same length, therefore you cannot rbind them together – tjebo Nov 30 '21 at 12:38
  • 2
    please provide some sample xml data to play around with.. – Wimpel Nov 30 '21 at 12:42
  • 1
    Welcome to SO, Allan Okwaro! Please make this question *reproducible*. In addition to the sample code you've attempted, please provide sample *unambiguous* data (e.g., `data.frame(x=...,y=...)` or the output from `dput(head(x))`) and intended output given that input. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans Nov 30 '21 at 12:44

0 Answers0