3 Dec 19:13
Re: Selecting levels from a list
Jeffrey_Warren@... writes: > I'm trying to select multiple levels from a list of factors but have not > been able to. Here is the list: > > > And the code I've tried so far: > > lesc.ddl$p$time==0.75 | 1.75 | 2.75 #returns all 'TRUE' values > > lesc.ddl$p$time==c(0.75 | 1.75 | 2.75) #returns all 'FALSE' values > Owen already gave you the solution. FYI, Your code didn't work because R didn't see what you thought it saw. lesc.ddl$p$time==0.75 | 1.75 | 2.75 gets interpreted as (lesc.ddl$p$time==0.75) | 1.75 | 2.75 The first part is true when time == 0.75. The second part, 1.75, is always true (i.e., not zero or false), so the expression as a whole is always true. Similarly, lesc.ddl$p$time==c(0.75 | 1.75 | 2.75) gets interpreted as(Continue reading)
RSS Feed