R/insertRow.R

Defines functions insertRow

Documented in insertRow

insertRow <-
function(dataframe, newrow, index){
  if(!(index == nrow(dataframe)+1)){
    dataframe[seq(index+1,(nrow(dataframe)+1)),] <- dataframe[seq(index,nrow(dataframe)),]
  }
  dataframe[index,] <- newrow
  return(dataframe)
}

Try the CNOGpro package in your browser

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

CNOGpro documentation built on May 2, 2019, 5:57 a.m.