Displaying 1 result from an estimated 1 matches for "myothervariablename".
2011 Sep 13
3
x %>% y as an alternative to which( x > y)
...table < x))
}
test <- c(NA, 1:4,NA,5)
test %>% 2
# [1] 3 4 6
test %<% 2
# [1] 1
Why do I want to do this?
Because in coding, I often end up with big chunks looking like this:
((mydataframeName$myvariableName > 2 & !is.na(mydataframeName$myvariableName)) & (mydataframeName$myotherVariableName == "male" & !is.na(mydataframeName$myotherVariableName)))
Which is much less readable/maintainable/editable than
mydataframeName$myvariableName > 2 & mydataframeName$myotherVariableName == "male"
But ">" returns anything involving an NA, so it breaks s...