Skip to content

Commit

Permalink
Initial commit of quick script to convert feather to RDA
Browse files Browse the repository at this point in the history
Since tableau can read an rda (and join with geojson)
(Tableau was erroring trying to read v12_link.json)
  • Loading branch information
lmz committed Feb 12, 2022
1 parent c81c07a commit 2a62f80
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/scripts/convert-feather-to-RDA.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Simple feather to RDA converter
# (Useful since Tableau doesn't read feather)
# See https://www.rstudio.com/blog/feather/
#
# USAGE: RScript --vanilla convert-feather-to-RDA.r input.feather output.rda
#
library("arrow")
args = commandArgs(trailingOnly=TRUE)

if (length(args) != 2) {
stop("Two arguments required: input.feather and output.rda")
}
print(paste("Reading input file:", args[1]))
input_df <- read_feather(args[1])

print(paste("Dataframe has",nrow(input_df),"rows and",ncol(input_df),"columns"))
print(paste("Writing output file:", args[2]))
save(input_df, file = args[2])

0 comments on commit 2a62f80

Please sign in to comment.