Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dplyr - how to select columns of certain type

Tags:

r

dplyr

Is there a concise way to select columns of certain type in dplyr? For example, how to select all character columns within a dplyr chain?

like image 330
paljenczy Avatar asked Dec 30 '15 08:12

paljenczy


People also ask

What does %>% do in dplyr?

%>% is called the forward pipe operator in R. It provides a mechanism for chaining commands with a new forward-pipe operator, %>%. This operator will forward a value, or the result of an expression, into the next function call/expression. It is defined by the package magrittr (CRAN) and is heavily used by dplyr (CRAN).


1 Answers

Dplyr 0.5 has the select_if() that allows you to write select_if(is.character)

like image 141
Rickard Avatar answered Sep 19 '22 12:09

Rickard