I want to extract data from a big and deep XML file. I followed your example 2 workflows with library(xml2) and it worked to generate a list of terminal nodes and xpaths. I can also run the "xml_dig_df" value extraction step. But the transformation of the data to a dataframe failed.
purrr::map(dplyr::bind_rows) => throws error "Argument 31 must have names"
Also, if I run the library(xml) workflow, setnames throws an error
"Can't assign 1 names to a 113576 column data.table"
traceback()
9: stop("Can't assign ", length(old), " names to a ", ncol(x), " column data.table")
8: setnames(x, value)
7: names<-.data.table(*tmp*, value = fields)
6: names<-(*tmp*, value = fields)
5: FUN(X[[i]], ...)
4: lapply(terminal_xpaths, xml_to_df, file = "cellosaurus.xml",
is_xml = FALSE, dig = FALSE)
3: eval(lhs, parent, parent)
2: eval(lhs, parent, parent)
1: lapply(terminal_xpaths, xml_to_df, file = "cellosaurus.xml",
is_xml = FALSE, dig = FALSE) %>% dplyr::bind_cols()
Is there a way to dig into the nested list of the
purrr::map(dplyr::bind_rows)
output to find our where/what the issue is ?
thank you
Thomas
I want to extract data from a big and deep XML file. I followed your example 2 workflows with library(xml2) and it worked to generate a list of terminal nodes and xpaths. I can also run the "xml_dig_df" value extraction step. But the transformation of the data to a dataframe failed.
purrr::map(dplyr::bind_rows) => throws error "Argument 31 must have names"
Also, if I run the library(xml) workflow, setnames throws an error
"Can't assign 1 names to a 113576 column data.table"
Is there a way to dig into the nested list of the
purrr::map(dplyr::bind_rows)
output to find our where/what the issue is ?
thank you
Thomas