You don’t need to wrap anything in a function – the following works
a = c(T,F,NA)
a %in% TRUE
[1] TRUE FALSE FALSE
More Related Contents:
- Logical operators (AND, OR) with NA, TRUE and FALSE
- Collapse / concatenate / aggregate a column to a single comma separated string within each group
- Filter data.frame rows by a logical condition
- Evaluate expression given as a string
- Pass a data.frame column name to a function
- What is the difference between require() and library()?
- How to sort a character vector where elements contain letters and numbers in R?
- Plot two graphs in same plot in R
- Add column which contains binned values of a numeric column
- Replace all 0 values to NA
- Paste multiple columns together
- How to find common elements from multiple vectors?
- Generate multiple graphics from within an R function
- Scheduling R Script
- Calculate group mean, sum, or other summary stats. and assign column to original data
- How to replace NA values in a table for selected columns
- What are the main differences between R data files?
- What are the differences between “=” and “
- Finding All Positions for Multiple Elements in a Vector
- Get filename without extension in R
- ending “+” prompt in R
- R round to nearest .5 or .1
- What do the %op% operators in mean? For example “%in%”?
- What does “Error: object ” not found” mean?
- Create categorical variable in R based on range
- Apply several summary functions (sum, mean, etc.) on several variables by group in one call
- Order of operator precedence when using “:” (the colon)
- Filtering rows in R unexpectedly removes NAs when using subset or dplyr::filter
- Difference between Boolean operators && and & and between || and | in R
- Add a box for the NA values to the ggplot legend for a continuous map