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

2015-04-01 Thread Arunkumar Srinivasan
David, In data.table v1.9.5 (current development version, which you can get from here: https://github.com/Rdatatable/data.table/wiki/Installation), new features were added to both `melt` and `cast` for data.tables. They both can handle multiple columns simultaneously. I think this would be of

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

2015-03-31 Thread John Kane
, 30 Mar 2015 06:50:59 -0700 To: r-help@r-project.org Subject: [R] data.frame: data-driven column selections that vary by row?? Sorry if that's confusing: I'm probably confused. :-( I am collecting and trying to analyze data regarding performance of computer systems. After extracting

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

2015-03-31 Thread Tom Wright
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)

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

2015-03-31 Thread Tom Wright
Not entirely sure I understand your problem here (your first email was a lot of reading). Would it make sense to add an extra column device_name Thus ending up with something like: Host Device Type host_Aada0ssd host_Aada1ssd host_Aada2hdd ... host_Nda3 ssd

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

2015-03-31 Thread David Wolfskill
On Tue, Mar 31, 2015 at 07:11:28AM -0800, John Kane wrote: I think we need some data and code Reproducibility https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example I apologize for failing to

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

2015-03-31 Thread Ista Zahn
Hi David, I suggest reading http://www.jstatsoft.org/v59/i10, then: 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) Best, Ista On Tue, Mar 31, 2015 at 1:22 PM,

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

2015-03-30 Thread David Wolfskill
Sorry if that's confusing: I'm probably confused. :-( I am collecting and trying to analyze data regarding performance of computer systems. After extracting the data from its repository, I have created and used a Perl script to generate a (relatively) simple CSV, each record of which contains: *