Mercurial > repos > deepakjadmin > r_caret_test
comparison caret_regression/tool1/csv2rdatatrain.R @ 0:68300206e90d draft default tip
Uploaded
| author | deepakjadmin |
|---|---|
| date | Thu, 05 Nov 2015 02:41:30 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:68300206e90d |
|---|---|
| 1 args <- commandArgs(TRUE) | |
| 2 ####source("/home/galaxy/galaxy-dist/tools/mpdstools/tool1/csv2rdatatrain2.R") | |
| 3 | |
| 4 csv2rdatatrain <- function(arg1,arg2){ file <- read.csv(arg1,row.names =1, header=T) | |
| 5 col <- ncol(file) | |
| 6 stopifnot(is.null(file) | col > 2 ) | |
| 7 | |
| 8 #cat("the Outcome column is not a factor vector.\n",file=stderr()) | |
| 9 stopifnot(is.numeric(file[,col])) | |
| 10 | |
| 11 # if(is.numeric(file[,col]) { | |
| 12 dataX <- file[,1:(col-1)] | |
| 13 dataY <- file[,col] | |
| 14 stopifnot(nrow(dataX) == length(dataY)) | |
| 15 save(dataX,dataY,file=arg2) | |
| 16 # }else { cat("the Outcome column has less number of entry than number of compounds.please check input file.\n",file=stderr()) | |
| 17 # } | |
| 18 } | |
| 19 | |
| 20 csv2rdatatrain(args[1],args[2]) | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 |
