The GoT challenge

Abierto
#254 8 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
66/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
r
Área
data

Línea de trabajo

Start with data-raw/got_pov-chars-wrangle.R, especially the linked lines using as_xml_document(), and reproduce the Root nodes must be of length 1 error with the shown pipeline. Compare the generated result with the existing inst/extdata/got_chars.xml; done means the package data can be regenerated with current xml2 functions or the relevant bug or documentation gap is identified.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

help wanted :heart: tidy-dev-day :nerd_face:

Transferring from Slack convo.

The GoT data in repurrrsive comes from an API but for teaching purposes, after I wrangle it into the list that ships with the package, I transform it back into JSON and XML files that also ship with the package.

The current script below data-raw/ uses an experimental branch of xml2 I created before xml2 had a nice function for this. I implemented as_xml() and the moral equivalent in xml2 today is as_xml_document(). But I can't just drop it in there.

https://github.com/jennybc/repurrrsive/blob/7ecc79f9a6b1925996ec20d78f0291d91451db31/data-raw/got_pov-chars-wrangle.R#L5-L7

https://github.com/jennybc/repurrrsive/blob/7ecc79f9a6b1925996ec20d78f0291d91451db31/data-raw/got_pov-chars-wrangle.R#L116-L120

> got_chars %>%
+   #xml2:::as_xml() %>%
+   as_xml_document() %>% 
+   as.character() %>% ## workaround to get explicit UTF-8 encoding
+   read_xml() %>%
+   write_xml(here("inst", "extdata", "got_chars.xml"))
Error: Root nodes must be of length 1

I haven't looked at this lately but I think there's either a buglet in as_xml_document() or a UI/documentation gap. It would be nice if I could reproduce the XML already in repurrrsive with current xml2 functions. This is a little detective adventure for someone.

Lenguaje dominante
R
Estrellas
227
Forks
86
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de r-lib/xml2

Todos los issues de r-lib/xml2

Issues similares

Más issues de R

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.