R/charkro.R

Defines functions charkro

Documented in charkro

charkro <- 
  function(x, y, sep = ":"){
    
    if(is.null(x) | is.null (y)) return(NULL)
    x <- as.character(x)
    y <- as.character(y)
    nx <- length(x)
    ny <- length(y)
    z <- vector("character", nx * ny)
    for(i in 1:nx){
      zind <- (1 + (i - 1) * ny):(ny + (i - 1) * ny)
      z[zind] <- paste(x[i], y, sep = sep)
    }
    z
    
  }

Try the npreg package in your browser

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

npreg documentation built on May 29, 2024, 4:17 a.m.