Try
my.data.frame[my.data.frame$Buy==1 | my.data.frame$Sell ==1, ]
or
subset(my.data.frame,buy == 1 | sell == 1)
Then take a look at the help page for || i.e., help("||")
to see what you did wrong.
- Phil Spector
I have a data frame with the following columns:
Date Price Buy Sell
The Buy and Sell variables are binary. They are either zero or 1.
Additionally, they are mutually exclusive. Either Buy is 1, Sell is 1 or
they are both 0. But they are never both 1 for a given observation.
I want to see observa
2 matches
Mail list logo