Export data from R
Arguments
- object
Object.
- con
character(1)
orconnection
. Data connection. Usecharacter(1)
to represent a file path.- ...
Additional arguments.
Details
The TxToGene
method automatically disables writing of column names, which
is the intended input format for tximport.
Examples
object <- S4Vectors::DataFrame(
"txId" = c(
"tx0001",
"tx0002",
"tx0003",
"tx0004"
),
"geneId" = c(
"gene0001",
"gene0001",
"gene0002",
"gene0002"
)
)
object <- TxToGene(object)
con <- file.path(AcidBase::tempdir2(), "tx2gene.csv")
export(object = object, con = con)
#> ℹ Exporting <TxToGene> intentionally without dimnames.
#> → Exporting /private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/Rtmp4LPYq0/L2TXQsfkpM-170173627032415/tx2gene.csv using base::`write.table()`.
x <- readLines(con, n = 4L)
print(x)
#> [1] "\"tx0001\",\"gene0001\"" "\"tx0002\",\"gene0001\""
#> [3] "\"tx0003\",\"gene0002\"" "\"tx0004\",\"gene0002\""
AcidBase::unlink2(con)