rnb.execute.export.csv {RnBeads} | R Documentation

## rnb.execute.export.csv

### Description

Exports (selected) methylation tables of the given dataset to comma-separated value files.

### Usage

    rnb.execute.export.csv(rnb.set, output.location,
      region.types = rnb.getOption("export.types"))

### Arguments

`rnb.set` | Methylation dataset as an object of type inheriting `RnBSet`.
`output.location` | `character` or `Report` specifying the output directory. If this is a report, the output directory is set to be a subdirectory named `csv` of the report's data directory. Set this parameter to the empty string (`""`) or `NA` to use the current working directory. If the given path does not exist, this function attempts to create it.
`region.types` | `character` vector indicating region types to be exported.

### Details

The names of the generated output files are formed by the prefix `"betas_"`, followed by a number between 1 and `length(region.types)`. The extension is `.csv` or `.csv.gz`, depending on the value of the RnBeads option `"gz.large.files"`. Any such files that already exist in the output directory, are overwritten.

There are several reasons why a certain output file cannot be (fully) generated. Examples for failures are listed below:

- The corresponding region type is invalid.

- The corresponding region type is not supported by the dataset. If the type is loaded in RnBeads, use the `summarize.regions` method prior to calling this function, in order to include the support of this region type in the dataset.

- Due to security restrictions, the creation of files in the output directory is not allowed.

- A file or directory with the same name exists and cannot be overwritten.

- The disk is full or the user quota is exceeded.

### Value

`character` vector containing the names of the files to which data were exported; prepended by `output.location`. In case a certain region type could not be exported (see the Details section), the corresponding element of this vector is `NA`.

### Author(s)

Yassen Assenov

### Examples

    library(RnBeads.hg19)
    data(small.example.object)
    rnb.execute.export.csv(rnb.set.example, "", summarized.regions(rnb.set.example))

[Package RnBeads version 1.12.1 Index]