BeSeLuFri
BeSeLuFri

Reputation: 653

Read ftr file into R

I want to open a .ftr file in R. [not a .feather file!].

But neither the feather package nor arrow one do the job e.g. both

ex1 <- feather::read_feather("bla.ftr")
ex2 <- arrow::read_feather("bla.ftr") 

do the job.

The arrow approach gives the following error message:

Error in ipc___feather___Reader__Read(self, columns) : 
  NotImplemented: LZ4 codec support not built

Is there any chance to read in a .ftr file?

For your reference, I created the .ftr file in python with pandas as in

bla.to_feather("bla.ftr")

with bla being a pandas.DataFrame

Upvotes: 1

Views: 977

Answers (1)

motabe
motabe

Reputation: 111

I think this is related to the compression of the file. I tried pyarrow instead of pandas opting for the 'uncompressed' file and it worked with R. I think pandas call pyarrow, but I don't know if you can pass the argument compression in pandas. In pyarrow this is the code:

feather.write_feather(df, file_path, compression='uncompressed')

Upvotes: 1

Related Questions