insertRow: Insert Row

View source: R/InsertRow.R

insertRowR Documentation

Insert Row

Description

This function adds a row to a df

Usage

insertRow(data, newrow, r)

Arguments

data

the input dataframe

newrow

a vector be added as a row, must be the same length as the number of coloumns in data.

r

the row index where the new row will be added into the dataframe.

Examples

df<-data.frame(a=c(1,3,4,5),
               b=c("a","c","d","e"),
               c=c("z","x","w","u"))

df_1<-insertRow(data=df,
                newrow=c(2,"b","y"),
                r=2)

df_1

BedeFfinian/Utilities.Package documentation built on April 14, 2025, 7:30 a.m.