Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

mutate_if and mutate_at functionality in one line

$
0
0

Is it possible to (1) use select helpers and (2) check type of columns to apply a function?

For example this will not work - I would like to convert to factor all integer columns the names of which do not contain "VAL":

dane_usa_nr%>% 
  mutate_at(vars(!contains("VAL")) & is.integer , as.factor)

Is it possible with some other syntax in dplyr?


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>