title: separating factor and character columns in r data frame using multiple condition
body: <p>I would like to separate only two types of a column of the data frame (factors and characters) and the following codes results in an error. I wonder what is the correct way to carry out this task.</p>
  <pre><code>install.packages(&quot;dslabs&quot;)
  library(dslabs)
  data(murders)
  
  names(murders)[sapply(murders, (is.factor | is.character))]
  </code></pre>
  <p>I can use the following code to combine the two, but I wonder what will be the correct format in case I want to use multiple conditions as the code above.</p>
  <pre><code>c(names(murders)[sapply(murders, is.factor)],names(murders)[sapply(murders, is.character)])
  </code></pre>