The GoT challenge

Đang mở
#254 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
66/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
r
Lĩnh vực
data

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
R
Star
227
Fork
86
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của r-lib/xml2

Tất cả issue của r-lib/xml2

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.