163
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 - if it had a like syntax - I would do something like:
select * from <> where x like 'hsa'.
Unfortunately, sqldf does not support that syntax.
Or similarly:
selectedRows <- df[ , df$x %like% "hsa-"]
Which of course doesn't work.
Can somebody please help me with this?