Weird behavior of as_list() output

Aperta
#354 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
r
Ambito
data

Direzione di ricerca

The report names read_xml() and as_list() but provides no reproducible XML, R code, file, or test. Start by constructing a minimal XML example and comparing the source with the list returned by as_list(). Done means distinct XML items retain their correct lengths and values, with a regression test for the behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

reprex

When converting an xml that is read into R using read_xml() into an R list using 'as_list()' the list structure details are correct but the each list item is actually the same and does not follow what the details suggest. I am going to insert a picture to help explain:
Screen Shot 2021-11-12 at 8 14 44 AM

The displayed "list of length " under the value column are correct, however when you expand as shown in the image the lengths are not actually what R says it should be. You can see this in the second and fifth "sec"s that I expanded in the attached screenshot. Moreover, all the list items are exactly the same as the first list item, this is not the case in the actual XML nor is it the case before using the as_list() function.

Any help would be greatly appreciated thank you.

Lingua principale
R
Stelle
227
Fork
86
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di r-lib/xml2

Tutte le issue di r-lib/xml2

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.