[R] function for filtering and deleting vector entries
babyluck
madruga at gmx.ch
Thu Mar 1 21:15:12 CET 2012
Thank you Rui, that helped a lot. The correct values show up when I'm using
the following code. Now fun(Temp,v) returns a matrix, and Temp and v
stay the same. But I'd like to use the reduced vectors in some
calculations..can they be "extracted" in some way so that I have them
separately again?
fun <- function(Temp, v){
unwanted <- Temp <= 16 | Temp >= 38.5
Temp <- Temp[!unwanted]
v <- v[!unwanted]
list(Temp=Temp, v=v)
}
fun(Temp,v)
PS: thank you too,andrija..but it's not what I'm looking for
--
View this message in context: http://r.789695.n4.nabble.com/function-for-filtering-and-deleting-vector-entries-tp4432410p4436217.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list