Skip to content

Instantly share code, notes, and snippets.

@dakl
Created July 22, 2008 21:18
Show Gist options
  • Save dakl/1289 to your computer and use it in GitHub Desktop.
Save dakl/1289 to your computer and use it in GitHub Desktop.
# filter flags
ff <- function(f, flags){
## if !all(dim(mat) == dim(flags)) break say "data and flags must have identical dimensions"
for(k in 1:ncol(f)){
idx.flags <- which( flags[,k] < 0 )
f[idx.flags,k] <- NA
cat("Number features filtered on slide ", k, ": ", length(idx.flags), "\n", sep="")
}
f
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment