I get an error when I try to read a R object from a RDS file which is located on an Arvados platform. First, I use the following code to connect to Arvados and get a file listing:
library('ArvadosR')
# Read ARVADOS_API_TOKEN and ARVADOS_API_HOST
readRenviron("~/.config/arvados/arv.conf")
# Connect to Arvados
arv = Arvados$new()
# Get collection object
coll = Collection$new(arv, "<collection_uuid>")
# List collection content
coll$getFileListing()
When I read a tab delimited file xyz.txt
with
df.a = read.delim(coll$get("xyz.txt")$connection("r"))
it works perfectly fine. However, when I try to read an RDS file abc.RDS
with
df.b = readRDS(coll$get("abc.RDS")$connection("r"))
I get the following error:
Error in readRDS(coll$get("abc.RDS")$connection("r")) :
unknown input format
Reading abc.RDS
from a local drive works fine. According to the help page, readRDS
accepts “a connection or the name of the file where the R object is saved to or read from”.