HenrikBengtsson / R.utils

đŸ”§ R package: R.utils (this is *not* the utils package that comes with R itself)
https://henrikbengtsson.github.io/R.utils/
62 stars 14 forks source link

View() confuses list elements commonly named #113

Closed earnaud closed 4 years ago

earnaud commented 4 years ago

Here is a little issue I am experiencing with the View() function: I parse severe .xsd files to work on their content. When I check the contents are correctly structured, I see that elements located on the same level that are named the same way are shown with View() as having the same content. (see screenshot)

Reprex I am working with the .xsd files for the Ecological Metadata Language. You can find them from here. Here is my chunk of code to read and view them:

library(XML)
library(dplyr)

xsd.files <- dir("/path/to/xsd/files/", pattern="eml", full.names = TRUE)
xsd <- lapply(xsd.files, function(file){
  xmlParse(file) %>% xmlRoot %>% xmlToList
})
names(xsd) <- basename(xsd.files)

View(xsd)

Once in the viewer pane, navigate to xsd / eml-access.xsd / complexType (1st) / choice / choice. Here are two element tags, and their .attr tags both contain 'allow' 'AccesssRule' (see screenshot).

Thanks you by advance for replying to this issue, and thanks you again for this great package !

image

HenrikBengtsson commented 4 years ago

Hi there. Great report. Unfortunately, that is for a function in the 'utils' package. This is about R.utils, cf. Issue #114

earnaud commented 4 years ago

Oh, I'm sorry :/

HenrikBengtsson commented 4 years ago

No worries