Displaying 1 result from an estimated 1 matches for "narepflag".
2011 Jun 23
3
problem (and solution) to rle on vector with NA values
...(x)
{
??? if (!is.vector(x) && !is.list(x))
??????? stop("'x' must be an atomic vector")
??? n <- length(x)
??? if (n == 0L)
??????? return(structure(list(lengths = integer(), values = x),
??????????? class = "rle"))
??? #### BEGIN NEW SECTION PART 1 ####
??? naRepFlag<-F
??? if(any(is.na(x))){
??????? naRepFlag<-T
??????? IS_LOGIC<-ifelse(typeof(x)=="logical",T,F)
??????? if(typeof(x)=="logical"){
??????????? x<-as.integer(x)
??????????? naMaskVal<-2
??????? }else if(typeof(x)=="character"){
??????????? naMaskVal<...