song
2  red      1      a 0.1836433  2  Irrelevant
```



---


#Selection - rows/observations

Use informative logical vectors as much as possible!


```r
&gt; tD
```

```
  pill events region     change id spotifysong
1  red      1      a -0.6264538  1  Irrelevant
2  red      1      a  0.1836433  2  Irrelevant
3  red      1      a -0.8356286  3  Irrelevant
```

```r
&gt; #Mark non-positive change as missing:
&gt; tD[tD$change &gt; 0, "change"] &lt;- NA
```

---

#Selection - columns/variables

*ALWAYS* us