iget {rirods} | R Documentation |
Retrieve File or Object from iRODS
Description
Transfer a file from iRODS to the local storage with iget()
or
read an R object from an RDS file in iRODS with ireadRDS()
(see readRDS()
).
Usage
iget(
logical_path,
local_path,
offset = 0,
count = 0,
verbose = FALSE,
overwrite = FALSE,
ticket = NULL
)
ireadRDS(logical_path, offset = 0, count = 0, verbose = FALSE, ticket = NULL)
Arguments
logical_path |
Source path in iRODS. |
local_path |
Destination path in local storage. By default,
the basename of the logical path; the file will be stored in the current
directory (see |
offset |
Offset in bytes into the data object. Deprecated. |
count |
Maximum number of bytes to write. Deprecated. |
verbose |
Whether information should be printed about the HTTP request and response. |
overwrite |
Whether the local file should be overwritten if it exists.
Defaults to |
ticket |
A valid iRODS ticket string. Defaults to |
Value
The R object in case of ireadRDS()
, invisibly NULL
in case of
iget()
.
The R object in case of ireadRDS()
, invisibly NULL
in case of iget()
.
See Also
iput()
for sending files,
isaveRDS()
for sending R objects to iRODS,
saveRDS()
for an R equivalent.
Transfer a file from iRODS to the local storage with iget()
or
read an R object from an RDS file in iRODS with ireadRDS()
(see readRDS()
).
Examples
is_irods_demo_running()
# connect project to server
create_irods("http://localhost:9001/irods-http-api/0.2.0")
# authenticate
iauth("rods", "rods")
# save the iris dataset as csv and send the file to iRODS
write.csv(iris, "iris.csv")
iput("iris.csv", "iris.csv")
# bring the file back with a different name
iget("iris.csv", "newer_iris.csv")
file.exists("newer_iris.csv") # check that it has been transferred
# send an R object to iRODS in RDS format
isaveRDS(iris, "irids_in_rds.rds")
# read it back
iris_again <- ireadRDS("irids_in_rds.rds")
iris_again
# delete objects in iRODS
irm("irids_in_rds.rds", force = TRUE)
irm("iris.csv", force = TRUE)