WARNING: these functions are deprecated as the saving/reading functions are already simple enough in the newer versions of the alabaster framework.
Read and write objects from a local staging directory.
These are just convenience wrappers around functions like loadObject
, stageObject
and writeMetadata
.
quickLoadObject(dir, path, ...)
quickStageObject(x, dir, path, ...)
String containing a path to the directory.
String containing a relative path to the object of interest inside dir
.
Further arguments to pass to loadObject
(for quickLoadObject
) or stageObject
(for quickStageObject
).
Object to be saved.
For quickLoadObject
, the object at path
.
For quickStageObject
, the object is saved to path
inside dir
.
All necessary directories are created if they are not already present.
A NULL
is returned invisibly.
local <- tempfile()
# Creating a slightly complicated object:
library(S4Vectors)
df <- DataFrame(A=1:10, B=LETTERS[1:10])
df$C <- DataFrame(D=letters[1:10], E=runif(10))
# Saving it:
quickStageObject(df, local, "FOOBAR")
# Reading it back:
quickLoadObject(local, "FOOBAR")
#> DataFrame with 10 rows and 3 columns
#> A B C
#> <integer> <character> <DataFrame>
#> 1 1 A a:0.0312303
#> 2 2 B b:0.2255625
#> 3 3 C c:0.3008308
#> 4 4 D d:0.6364656
#> 5 5 E e:0.4790245
#> 6 6 F f:0.4321713
#> 7 7 G g:0.7064338
#> 8 8 H h:0.9485766
#> 9 9 I i:0.1803388
#> 10 10 J j:0.2168999