-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
When using multiple taxonomies, the order in the json changes. This might not be an issue if properly handling json file, but when the json is flattened as I do in R, the order matters.
For example:
"taxonomy_values":{
"Corruption_cases":"Other",
"Frame attack-defense":"Attack"
}
And:
"taxonomy_values":{
"Frame attack-defense":"Attack",
"Corruption_cases":"Gürtel-Valencia"
}
So, before processing them in R we have to be sure they are in the same order.
Load data:
dataorigen <- fromJSON(file="raw-areas.json")
areas <- dataorigen$areas
areas <- lapply(areas, function(x) {
x[sapply(x, is.null)] <- NA
unlist(x)
})
# Important: this line flattens the json. and mizes taxonomies
pox <- as.data.frame(do.call("rbind", areas))
So we need to see which is the order of the first row and use it in all the others.
Metadata
Metadata
Assignees
Labels
No labels