inst/Examples/undefinedVector.R

setMethod("undefined<-",
          signature(x="vector", value = "vector"),
          function(x, codes = NULL, value) {
              if(length(codes) > 0)
                  x[x %in% codes] <- NA
              x[is.na(x)] <- value
              x
          })

Try the SoDA package in your browser

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

SoDA documentation built on Oct. 28, 2020, 9:07 a.m.