R/removeNAenv.R

Defines functions `removeNAenv`

`removeNAenv` <-
function(x,variable) {
    subs <- is.na(x[,variable])
    subs <- (subs==F)
    x <- x[subs,,drop=F]
    for (i in 1:ncol(x)) {
        if (is.factor(x[,i])) {x[,i] <- factor(x[,i][drop=T])}
    }
    return(x)
}

Try the BiodiversityR package in your browser

Any scripts or data that you put into this service are public.

BiodiversityR documentation built on Jan. 6, 2023, 5:18 p.m.