xdf_utils: Utility functions for working with Xdf files

Description Usage Arguments Details Value See Also Examples

Description

Copy, move, rename and delete an Xdf file.

Usage

1
2
3
4
5
6
7
copy_xdf(src, dest)

move_xdf(src, dest)

rename_xdf(src, dest)

delete_xdf(xdf)

Arguments

src

For copy_xdf, move_xdf and rename_xdf, an Xdf data source object (not a filename).

dest

For copy_xdf, move_xdf and rename_xdf, a character string giving the destination file. Note that for rename_xdf, this should only be a base name, not a full path.

xdf

For delete_xdf, an Xdf data source object.

Details

The copy_xdf function copies the Xdf file given by src to the location specified by dest, possibly renaming it as well; move_xdf moves the file. rename_xdf does a strict rename (the location of the file is unchanged, only its name). delete_xdf deletes the file given by xdf.

These are utility functions for working with the files/directories where the data for an Xdf data source is stored. They make use of low-level OS functionality, so should be more efficient than running rxDataStep. They work with both standard and composite Xdf files, and with data stored both in the native filesystem and in HDFS.

Value

copy_xdf, move_xdf and rename_xdf return an Xdf data source object pointing to the new file location. delete_xdf returns TRUE if the delete operation succeeded, FALSE otherwise.

See Also

file.copy, file.rename, unlink, rxHadoopCopy, rxHadoopMove, rxHadoopRemove, rxHadoopRemoveDir

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mtx <- as_xdf(mtcars, overwrite=TRUE)

mtx2 <- copy_xdf(mtx, "mtcars2.xdf")
head(mtx2)
delete_xdf(mtx2)
file.exists("mtcars2.xdf")  # FALSE

mtx2 <- rename_xdf(mtx, "mtcars2.xdf")
file.exists("mtcars.xdf")   # FALSE
file.exists("mtcars2.xdf")  # TRUE

RevolutionAnalytics/dplyrXdf documentation built on June 3, 2019, 9:08 p.m.