Skip to content

Commit

Permalink
Clean up convert.R [no ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
chainsawriot committed Sep 7, 2023
1 parent 45f37bd commit 21a9676
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions data-raw/convert.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@

writeLines(jsonlite::read_json("data-raw/single.json", TRUE))
writeLines(
jsonlite::prettify(jsonlite::toJSON(jsonlite::read_json(here::here("data-raw/single.json"), TRUE))),
here::here("data-raw/single.json")
)
rio_formats <- rio::import(here::here("data-raw", "single.json"))

usethis::use_data(rio_formats, overwrite = TRUE, internal = TRUE)

require(data.table)
rf <- data.table(rio_formats)[type %in% c("import", "suggest", "archive"), !"ext"]
short_rf <- rf[, paste(input, collapse = " / "), by = format_name]
type_rf <- unique(rf[,c("format_name", "type", "import_function", "export_function", "note")])

feature_table <- short_rf[type_rf, on = .(format_name)]

colnames(feature_table)[2] <- "signature"

setorder(feature_table, "type", "format_name")

0 comments on commit 21a9676

Please sign in to comment.