R/createDF.R

Defines functions .createDF

.createDF <- function(cnv){

  m <- nrow(x = cnv)

  # {2*m x 4}
  id <- rep(x = 1L:m, each = 2L)
  df1 <- data.frame('id' = cnv$ID, 
                    'loc' = cnv$BP1,  
                    'chr' = cnv$CHR,  
                    'type' = cnv$TYPE)[id,]
  df1[{1L:m}*2L,'loc'] <- cnv$BP2
  df1[{1L:m}*2L,'type'] <- 2.0

  rownames(x = df1) <- NULL

  return( df1 )

}

Try the CONCUR package in your browser

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

CONCUR documentation built on June 7, 2022, 5:07 p.m.