Mercurial > repos > deepakjadmin > caret_reg_tool1
comparison csv2rdatatrain.R @ 0:8b939f621c64 draft default tip
Uploaded
author | deepakjadmin |
---|---|
date | Fri, 22 Jan 2016 14:13:39 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:8b939f621c64 |
---|---|
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 |