search for: currentr2

Displaying 1 result from an estimated 1 matches for "currentr2".

2010 Jul 16
3
Help with Sink Function
...ceTrainSample$pID50) pID50Train <- miceTrainSample$pID50 lmTrain <- lm(predictedTrain~pID50Train) slm <- summary(lmTrain) str(slm) if (i == 1) { previousR2 <-slm$r.squared sink(file="R2outputKKNN.txt", append=TRUE) previousR2 sink() } else if(i!=1) { currentR2 <- slm$r.squared if (previousR2 > currentR2) { currentR2 <- previousR2 } if (previousR2 < currentR2) { sink(file="R2outputKKNN.txt", append=TRUE) currentR2 sink() } } } In my code above, I can't get sink to work. In summary, I'm trying...