Skip to content

help on matrix column removal based on another matrix results

3 messages · iembry, Rui Barradas

#
Hi everyone, now I am trying to finish writing the code (I had asked for
assistance on subtracting arrays)

This is what I what I am running in R:
NSEr <- function (obs, sim)
{
{jjh <- (as.vector(obs) - sim)^2
Xjjhs <- apply(Xjjh, 2, sum)
Yii <- (obs - mean(obs))^2
Yiis <- apply(Yii, 2, sum)
NSEr <- 1 - (Xjjhs/Yiis)
}
NSEr}
**Vsim becomes numeric[42016] rather than a double matrix of 101x416. 

What is the proper way to remove the columns in Vsim where the NSEr for that
column is less than 0.6? I am trying to make Vsim a double matrix of
101x416. 

Thank-you again.



Below is the rest of the code in R:
--
View this message in context: http://r.789695.n4.nabble.com/help-on-matrix-column-removal-based-on-another-matrix-results-tp4650043.html
Sent from the R help mailing list archive at Nabble.com.
#
Hello,

Try

Vsim[] <- Vsim[NSErr > 0.6, ]


Hope this helps,

Rui Barradas
Em 19-11-2012 14:30, iembry escreveu:
#
Sorry, the comma is in the wrong place, it should be

Vsim[] <- Vsim[ , NSErr > 0.6]

Rui Barradas
Em 19-11-2012 16:18, Rui Barradas escreveu: