[R] data.frame: data-driven column selections that vary by row??

Tom Wright tom at maladmin.com
Tue Mar 31 20:35:19 CEST 2015


Nice clean-up!!!

On Tue, 2015-03-31 at 14:19 -0400, Ista Zahn wrote:
> library(tidyr)
> library(dplyr)
> bw <- gather(bw, key = "tmp", value = "value",
> matches("^d[a-z]+[0-9]+"))
> bw <- separate(bw, tmp, c("disc", "var"), "_", extra = "merge")
> bw <- spread(bw, var, value)



More information about the R-help mailing list