RIO: universal import/export in R

after a while using R it’s not unusual to struggle when importing files. Sometimes issues with factors, separators, and the like….lucky me, arrived to a wonderful package: RIO

https://github.com/leeper/rio

RIO makes your life easier making importing, exporting and converting between formats easy as pie. Just setting the path to file, ‘cause RIO is smart enough to figure it out the rest.

let’s see:

install.packages(“rio”)
library(rio)
# reading and importing file
my.df <- import(“path_to_file.csv”)

# exporting to Excel (refer to vignette for available formats)
export(my.df, format = "xlsx”, file = "my_excel_file.xlsx)

# converting
convert(“my_file.csv” , “new_file.json”)

Bon Appetit