saveDict: Write a PGCA dictionary to a text file

Description Usage Arguments Value See Also Examples

View source: R/utilities.R

Description

Write the dictionary to a text file using the write.table function. By default, a tab-separated file is written, but this can be changed by changing the arguments to write.table.

Usage

1
saveDict(dict, file = stop("`file` must be specified"), ...)

Arguments

dict

a PGCA dictionary.

file

either a character string naming a file or a connection open for writing. "" indicates output to the console.

...

further arguments passed to write.table.

Value

This function returns NULL invisibly.

See Also

pgcaDict to create the dictionary, and applyDict to apply the dictionary for translating data files.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Build accession dictionary from all files in a directory
dict <- pgcaDict(
         system.file("extdata", package="pgca"),
         col.mapping=c(gene.symbol="Gene_Symbol")
)

# Save dictionary to a temporary file
dictOutFile <- tempfile()
saveDict(dict, file=dictOutFile)

# Change the separator string to a tab
dictOutFile <- tempfile()
saveDict(dict, file=dictOutFile, sep="\t")

pgca documentation built on Nov. 8, 2020, 8:30 p.m.