I have read in a csv file in matrix form (having m rows and n columns). I want to filter the matrix by conducting a filter in verbal form:
Select all values from column x where the values of an another column in this row is equal to “blabla”.
It is like a select statement in database where I say I am interested in a subset of the matrix where these constraints need to be satisfied.
How can I do it in r? I have the data as dataframe and can access it by the headers. data["column_values" = "15"] does not give me back the rows where the column named column_values have values 15 only.
Thanks
You said you just wanted the column x values where column_values was 15, right?
I think this may come as a dataframe so it’s possble you may need to unlist() it and maybe even “unfactor” it.
If you want all of the columns you can drop the third argument (the select= argument):