[R] My first R program
Shai Shen-Orr
lvssso at bioinfo.weizmann.ac.il
Wed Apr 5 19:30:32 CEST 2000
Hi,
Sorry to bother you guys with this syntax problem, this is my first R
program, and I seem to not have grasped something right. I keep getting
an error message from 'parse' on the line with the *** :
pValCalculator(b, n=20, m=20)
{
ind <- 1:min(c(n,m))
prob <- (1-pnorm(b,sd=std*sqrt(ind)))
prob1 <- sum((n-ind+1)*(m-ind+1)*prob)
prob1
}
inputData <-
scan("/users/lvssso/projects/LAMA/output/pValLamaScore.tmp", list(block1
= "",block2 = "",width1 = 0,width2 = 0,alignment = 0,score = 0));
pVal <- vector(mode = "numeric", length(lamaScore));
for(i in 1:length(inputData$lamaScore)
***** pVal[i] <- pValCalculator(inputData$score, inputData$width1,
inputData$width2);
inputData$pValue <- list(pVal);
write.table(inputData, file = "pValLamaScore.out", row.names = FALSE,
col.names = FALSE, sep = "\t");
Thanks,
Shai
--
Shai Shen-Orr
Crown Human Genome Center and Bioinformatics Unit,
Weizmann Institute of Science
Home page and more contact info: http://bioinfo.weizmann.ac.il/~lvssso
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list