I need to have a data frame from json or xml files (data is available in both formats here). Yet, I get errors when I try to get those data frames in R.
With json file, the error is the following text
Error in parse_con(txt, bigint_as_char) : lexical error: invalid bytes in UTF8 string. stion":"0","name_question":"Óðî÷èñòå çàñ³äàííÿ Âåðõîâíî¿ Ðàä (right here) ------^
With xml file, the error is like this
Error in
[<-.data.frame
(*tmp*
, i, names(nodes[[i]]), value = c(date_agenda = "27112014", : duplicate subscripts for columns
The commands I use are
library(jsonlite)
library(XML)
k <- fromJSON("https://data.rada.gov.ua/ogd/zal/ppz/skl8/dict/agendas_8_skl.json", encoding = "UTF-8")
m <- xmlToDataFrame("agendas_8_skl.xml")
Prior to executing the commands, I download files to the working directory.
I do not understand how I can get the data. Please, help!