Displaying 1 result from an estimated 1 matches for "indmax".
2010 Dec 06
1
R cmd batch with parameters
...rom R with the parameters set fixed.
I'd really very much appreciate comment where I go wrong and possible
solutions. I paste the code below:
spinR <- function(){
args<-(commandArgs())
dataVec <- read.table(args[1], sep=" ")
attach(dataVec)
a<-dim(dataVec)
indMax<- 1:a[2]
for(i in 1:a[2]){
indMax[i]<-which.max(dataVec[,i])
}
write.table(indMax, file=args[2], col.names=FALSE, row.names=FALSE)
}
How would I pass the arguments via command line? Are the file names
passed in quotes?
thank you so much in advance!!!
Ania
--
View this messa...