Skip to contents

Saves a bambamR result object or any R object as an RDS file.

Usage

bb_export_rds(result, path)

Arguments

result

An R object to save (typically a bb_result or DE result).

path

Character. File path for the output .rds file.

Value

The path invisibly.

Examples

tmp <- tempfile(fileext = ".rds")
counts <- matrix(rpois(100, 50), nrow = 10,
  dimnames = list(paste0("g", 1:10), paste0("s", 1:10)))
bb_export_rds(counts, tmp)
#> Saved to: /tmp/RtmpyWdY15/file19ec267f1f7e.rds
readRDS(tmp)
#>     s1 s2 s3 s4 s5 s6 s7 s8 s9 s10
#> g1  52 52 45 53 62 42 46 53 50  52
#> g2  41 49 46 53 41 48 53 49 52  51
#> g3  61 50 50 54 54 45 60 57 55  58
#> g4  39 41 52 56 49 41 58 60 63  50
#> g5  47 46 53 52 41 49 51 49 42  50
#> g6  52 52 50 50 45 53 47 43 48  44
#> g7  56 53 38 55 38 62 47 54 62  50
#> g8  45 43 48 48 56 47 63 67 49  56
#> g9  51 47 42 44 40 59 62 43 50  48
#> g10 58 43 57 68 41 54 40 44 52  53