df <- data.frame(
id = 1:5,
name = c("John", "Jane", "Bob", "Alice", "John"),
age = c(25, 30, 35, 28, 40)
)
# Search across all columns where age > 30
search_record(df, where = age > 30)
# Search only in the name column for "John"
search_record(df, column = "name", where = name == "John")
# Search using column index
search_record(df, column = 2, where = name == "Jane")
Run the code above in your browser using DataLab