I want to select rows from a data frame based on partial match of a string in a column, e.g. column \'x\' contains the string "hsa". Using sqldf -
sqldf
Another option would be to simply use grepl function:
grepl
df[grepl('er', df$name), ] CO2[grepl('non', CO2$Treatment), ] df <- data.frame(name = c('bob','robert','peter'), id = c(1,2,3) ) # name id # 2 robert 2 # 3 peter 3