In the search, I found a lot of questions on how to do this for columns, but not for rows.
# Works just fine:
data = as.data.table(iris)
head(data[Species == 'setosa'])
# I want to do it programatically:
varname = 'Species'
head(data[varname == 'setosa']) # Doesn't work
head(data[(varname) == 'setosa']) # Doesn't work
head(data[(varname) == 'setosa', with = F]) # Doesn't work
Any advice on the correct syntax here would be greatly appreciated.