Skip to contents

Export data from R

Usage

export(object, con, ...)

# S4 method for SummarizedExperiment,character
export(
  object,
  con,
  bindRowData = FALSE,
  compress = FALSE,
  overwrite = TRUE,
  quiet = FALSE
)

Arguments

object

Object.

con

character(1) or connection. Data connection. Use character(1) to represent a file path.

bindRowData

logical(1). Whether to column bind row data (e.g. gene annotations), slotted in rowData, to each exported assay matrix, defined in assays.

compress

logical(1). Apply gzip compression to all files.

overwrite

logical(1). Overwrite existing file on disk.

quiet

logical(1). Perform command quietly, suppressing messages.

...

Additional arguments.

Value

Invisible character or list of file paths.

Note

Updated 2023-10-05.

See also

Examples

data(RangedSummarizedExperiment, package = "AcidTest")

## SummarizedExperiment ====
object <- RangedSummarizedExperiment
con <- AcidBase::tempdir2()
x <- export(object = object, con = con)
#> → Exporting <SummarizedExperiment> to /private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpZ1UL1t/GmzMoOqA9f-170173567411495.
#> → Exporting assays "counts" to /private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpZ1UL1t/GmzMoOqA9f-170173567411495/assays.
#> → Exporting /private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpZ1UL1t/GmzMoOqA9f-170173567411495/assays/counts.csv using base::`write.table()`.
#>  Dropping 2 non-atomic columns: "geneSynonyms", "ncbiGeneId".
#> → Exporting /private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpZ1UL1t/GmzMoOqA9f-170173567411495/rowData.csv using base::`write.table()`.
#> → Exporting /private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpZ1UL1t/GmzMoOqA9f-170173567411495/colData.csv using base::`write.table()`.
print(x)
#> $assays
#> $assays$counts
#> [1] "/private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpZ1UL1t/GmzMoOqA9f-170173567411495/assays/counts.csv"
#> 
#> 
#> $rowData
#> [1] "/private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpZ1UL1t/GmzMoOqA9f-170173567411495/rowData.csv"
#> 
#> $colData
#> [1] "/private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpZ1UL1t/GmzMoOqA9f-170173567411495/colData.csv"
#> 
AcidBase::unlink2(con)