Learn R Programming

TDMR (version 2.2)

tdmReadDataset: Read data accoroding to opts settings.

Description

Read the data accoring to the settings opts$READ.* and opts$TST.COL (see Details).

Usage

tdmReadDataset(opts)

Arguments

opts

list of options, we need here

  • READ.TrnFn: [tdmReadTrain] function with argument opts for reading the training data and returning them in a data frame

  • READ.NROW: [-1] read only that many rows from opts$filename. -1 for 'read all rows'.

  • READ.TstFn: [NULL] function with argument opts for reading the test data and returning them in a data frame. If NULL then skip test file reading.

  • TST.COL: ["TST.COL"] string, create a column with the name of this string in dset, which has 0 for training and 1 for test data

  • path: used by READ.TrnFn to locate file

  • dir.data: used by READ.TrnFn to locate file

Value

dset, a data frame with all data read

Details

When opts$READ.TstFn==NULL, then only opts$READ.TrnFn is used. When opts$READ.TstFn!=NULL, the following things happen in tdmReadDataset: Data are read from opts$filename and from opts$filetest. Both data sets are bound together, with a new column opts$TST.COL having '0' for the data from opts$filename and having '1' for the data from opts$filetest. The branch using opts$TST.COL is invoked either with umode="TST" in unbiasedRun or with opts$TST.kind="col" in tdmModCreateCVindex.

See Also

tdmReadAndSplit