Feather provides binary columnar serialization for data frames.It is designed to make reading and writing data frames efficient,and to make sharing data across data analysis languages easy.write_feather() can write both the Feather Version 1 (V1),a legacy version available starting in 2016, and the Version 2 (V2),which is the Apache Arrow IPC file format.The default version is V2.V1 files are distinct from Arrow IPC files and lack many features,such as the ability to store all Arrow data tyeps, and compression support.write_ipc_file() can only write V2 files.
Arguments
- x
data.frame,RecordBatch, orTable- sink
A string file path, connection, URI, orOutputStream, or path in a filesystem (
SubTreeFileSystem)- version
integer Feather file version, Version 1 or Version 2. Version 2 is the default.
- chunk_size
For V2 files, the number of rows that each chunk of datashould have in the file. Use a smaller
chunk_sizewhen you need fasterrandom row access. Default is 64K. This option is not supported for V1.- compression
Name of compression codec to use, if any. Default is"lz4" if LZ4 is available in your build of the Arrow C++ library, otherwise"uncompressed". "zstd" is the other available codec and generally has bettercompression ratios in exchange for slower read and write performance."lz4" is shorthand for the "lz4_frame" codec.See
codec_is_available()for details.TRUEandFALSEcan also be used in place of "default" and "uncompressed".This option is not supported for V1.- compression_level
If
compressionis "zstd", you mayspecify an integer compression level. If omitted, the compression codec'sdefault compression level is used.
Value
The inputx, invisibly. Note that ifsink is anOutputStream,the stream will be left open.
See also
RecordBatchWriter for lower-level access to writing Arrow IPC data.
Schema for information about schemas and metadata handling.