Skip to content

Instantly share code, notes, and snippets.

@agricolamz
Last active March 25, 2025 16:44
Show Gist options
  • Save agricolamz/df50b1377bd1011cce65de83fc5131af to your computer and use it in GitHub Desktop.
Save agricolamz/df50b1377bd1011cce65de83fc5131af to your computer and use it in GitHub Desktop.
library(tidyverse)
readxl::read_xlsx("data.xlsx") |>
filter(corpus == "Dagestan.xml",
!is.na(string_id)) ->
df
df |>
select(where(function(x) sum(is.na(x)) != nrow(df))) |>
select(-person_id, -corpus) |>
xmlconvert::df_to_xml(record.tag = "person", root.node = "meta") |>
xml2::write_xml("result.xml")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment