ImportSamples          package:TargetSearch          R Documentation

_S_a_m_p_l_e _d_e_f_i_n_i_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     This function imports a sample list that will be processed from a
     tab delimited file.

_U_s_a_g_e:

     ImportSamples(sampfile, CDFpath = ".", RIpath = ".", ...)

_A_r_g_u_m_e_n_t_s:

sampfile: A character string naming a sample file. See details. 

 CDFpath: A character string naming a directory where the CDF files are
          located. 

  RIpath: A character string naming a directory where the RI corrected
          text files are/will be located. 

     ...: Other options passed to 'read.delim' function. 

_D_e_t_a_i_l_s:

     The sample file is a tab-delimited text file with at least two
     columns:


        *  'CDF_FILE' - The list of baseline corrected CDF files.

        *  'MEASUREMENT_DAY' - The day when the sample was measured.

     The column names must be exactly those indicated, but the column
     order doesn't matter. Other columns could be included in that
     file. They won't be used by the script, but will be included in
     the sample R object.

_V_a_l_u_e:

     A 'tsSample' object.

_A_u_t_h_o_r(_s):

     Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

_S_e_e _A_l_s_o:

     'ImportLibrary', 'tsSample'

_E_x_a_m_p_l_e_s:

     # get the sample definition definition file
     cdfpath <- file.path(.find.package("TargetSearchData"), "gc-ms-data")
     sample.file  <- file.path(cdfpath, "samples.txt")

     # set a path where the RI files will be created
     RIpath <- "."

     # import samples
     sampleDescription <- ImportSamples(sample.file, CDFpath = cdfpath, RIpath = RIpath)

     # change the sample names
     sampleNames(sampleDescription) <- paste("Sample", 1:length(sampleDescription), sep = "_")

     # change the file paths (relative to the working path)
     CDFpath(sampleDescription) <- "my_cdfs/"
     RIpath(sampleDescription)  <- "my_RIs/"

