I'm just starting to learn data.table in r and
library(data.table)
data(iris)
iris[Species == 'setosa']
The code above doesn't filter the rows where the species are setosa in the dataset, it just print the rows where the condition is satisfied.
iris <- iris[Species == 'setosa']
The above code works, but I'm wondering what kind of situation I need to assign a new object for the operation to be effective and not just print the results. Also, is there any risk in assigning on the same object?