df <- data.frame(A = 1:5, B = letters[1:5])
# Delete a specific row
delete_record(df, position = 2)
# Delete multiple rows
delete_record(df, position = c(2, 4))
# Use truncate to clear the data frame
delete_record(df, position = NULL, keep_rows = FALSE)
# Keep non-NA cells but empty rows
delete_record(df, position = NULL, keep_rows = TRUE)
Run the code above in your browser using DataLab