ncdf4Convert,tsSample-method {TargetSearch} | R Documentation

## Method for converting CDF-3 files to CDF-4

### Description

`ncdf4Convert` is a high level method used to convert from CDF-3 to ‘TargetSearch’ new CDF-4 custom file format.

### Usage

        ncdf4Convert(obj, path, ...)

### Arguments

`obj` | A `tsSample` object
`path` | A character vector representing file path in which the newly created CDF-4 files will be stored. If missing, the files will be save in the same directory as the source CDF-3 files
`...` | Extra arguments passed to `ncdf4_convert`, such as baseline correction options.

### Details

This is a high level interface to `ncdf4_convert` which uses a `tsSample` as input. The advantage of using this function is that it updates the paths to the CDF-4 files for downstream analysis.

The parameter `path` can be used to change the original paths, which may be necessary if those files are on a read-only file-system. If this parameter is missing, the same paths are used. Note that the path are re-cycled to match the length of the samples.

The ... can be used to pass extra arguments to `ncdf4_convert` and to `baseline`. Refer to those man pages for details.

### Value

A new `tsSample` object with updated CDF-4 file paths. The files are converted in the background.

### Author(s)

Alvaro Cuadros-Inostroza

### See Also

`ncdf4_convert`

### Examples

    require(TargetSearchData)
    data(TSExample)
    # get the CDF files
    cdfpath <- file.path(find.package("TargetSearchData"), "gc-ms-data")

    # update the CDF path
    CDFpath(sampleDescription) <- cdfpath

    # tranform the CDF (the files are copied in the current directoru)
    newSamples <- ncdf4Convert(sampleDescription, path=".")

[Package TargetSearch version 1.44.0 Index]