# Create sample data frame
df <- data.frame(
name = c("John", "Jane"),
age = c(25, 30)
)
# Add a single record as a list
df <- add_batch_record(df, list(name = "Bob", age = 35))
# Add multiple records as data frames
new_records <- data.frame(
name = c("Alice", "Charlie"),
age = c(28, 40)
)
df <- add_batch_record(df, new_records, .before = 2)
Run the code above in your browser using DataLab