R/f.insert.row.R

Defines functions f.insert.row

f.insert.row <- function( df, newrow, r ){
	if( r != ( nrow( df ) + 1 ) ){
		df[ seq( r + 1, nrow( df ) + 1 ), ] <- df[ seq( r, nrow( df ) ), ]
	}
	df[ r, ] <- newrow
	return( df )
}

Try the Haplin package in your browser

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

Haplin documentation built on May 20, 2022, 5:07 p.m.