These functions provide support reading and writing routes and intervals from and to HDF5 files while preserving class names and attributes.
Usage
write_routes(obj, path)
# S3 method for class 'Routes'
write_routes(obj, path)
# S3 method for class 'BirdFlowRoutes'
write_routes(obj, path)
# Default S3 method
write_routes(obj, path)
read_routes(path)
read_intervals(path)
write_intervals(obj, path)Value
write_routes()answrite_invervals()invisibly return their input object (after writing to disk).read_routes()returns the written object - eitherRoutesorBirdFlowRoutes.read_intervals()return the writtenBirdFlowIntervalsobject.
Details
The Hierarchical Data Format version 5 (HDF5) is an open format to efficiently store large, heterogeneous data sets. HDF5 files can be written and read from R and Python among other languages so make a good cross-language format for routes and intervals.
read_routes() and write_routes() work on both Routes and
BirdFlowRoutes. See Routes() and as_BirdFlowRoutes() to create
objects of these classes.
read_intervals() and write_intervals() work on BirdFlowIntervals
which are a collection of movements each with a single start and end
derived from BirdFlowRoutes(). See as_BirdFlowIntervals().
Internal functions
write_r_object_h5()andread_r_object_h5()are internal workhorses: they handle the recursive traversal of R lists (including data.frames, Date/POSIX/Factor vectors) and store both data and class attributes in the HDF5 file hierarchy.
See also
rhdf5::h5createFile, rhdf5::h5write, rhdf5::h5read for low-level HDF5 operations.
import_birdflow(), andexport_birdflow()for reading and writing BirdFlow models. Noteimport_birdflow()also substantially alters the object if it has not previously been imported into R.
