-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
featurea feature request or enhancementa feature request or enhancement
Description
Issue Description
as_list() will convert element text into a list of length 1 with a single character element. I would expect it to "simplify" or "unbox" the text so it is not a list. The XML package already has this type of behavior in using xmlToList().
Reproducible Example
In the example below the "bar" element text "Hello" is represented as a list. I would expect it to be a character string.
library(xml2)
as_list(read_xml("<bar>Hello</bar>"))
#> $bar
#> $bar[[1]]
#> [1] "Hello"
# the desired result would be
#> $bar
#> [1] "Hello"The XML package has similar style to the more desirable behavior.
library(XML)
xmlToList(newXMLNode("bar","Hello"))
#> [1] "Hello"igarleni, BenjaminWolfe, jsowder, Rathpete and FGL-Linear
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancement