I'm currently working with data that contains a tuple in one of the columns and I want to test for certain values in that column. The type of that column is integer, so I cannot test for strings, hoever, R also doesn't find the values in any other way and I get only false
.
My data in this column looks similar to this: (1,1)
and I want to test: row==(1,1)
. However, like this I get an error message, about the unexpected comma after row==(1
. When I try row=="(1,1)"
I get false
as well, because typeof(row) = integer
. Do you have any suggestion, how I could solve this? Thanks!
My data looks like this:
show(head(dataframe))
Generation Patch Environment
10 (1, 1) 0.3378703
10 (1, 2) 0.4121443
10 (1, 3) 2.1544672
10 (1, 4) -0.4552965
10 (1, 5) -0.6643103
10 (1, 6) 1.2926155
and I want to test (and get a boolean answer) where dataframe$Patch == (1,1)
. The desired answer would be somethineg like c(true, false, false, false, false, false)
.