Re: [R] dplyr help

2017-07-11 Thread Jeff Newmiller
> >-Original Message- >From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] >Sent: 10 July 2017 03:52 PM >To: r-help@r-project.org; Mangalani Peter Makananisa; >r-help@r-project.org >Cc: Vito Ricci (vito_ri...@yahoo.com) >Subject: Re: [R] dplyr help > >I

Re: [R] dplyr help

2017-07-11 Thread Mangalani Peter Makananisa
t;, "360", "420", "480" ), class = "factor")), .Names = c("pokus", "minuty"), row.names = c(NA, -23L), class = "data.frame") Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Be

Re: [R] dplyr help

2017-07-11 Thread Mangalani Peter Makananisa
@r-project.org Cc: Vito Ricci (vito_ri...@yahoo.com) Subject: Re: [R] dplyr help I am pretty sure that this is not a question about dplyr... it is a question about tidyr. Look at the help file ?tidyr::spread. If I understand your question (I may not, because you gave no example of input/output

Re: [R] dplyr help

2017-07-10 Thread Jeff Newmiller
I am pretty sure that this is not a question about dplyr... it is a question about tidyr. Look at the help file ?tidyr::spread. If I understand your question (I may not, because you gave no example of input/output data), the answer is no, the column names come from the column named by the key

Re: [R] dplyr help

2017-07-10 Thread PIKAL Petr
; ), class = "factor")), .Names = c("pokus", "minuty"), row.names = c(NA, -23L), class = "data.frame") Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Mangalani > Peter Makananisa > Sen

[R] dplyr help

2017-07-10 Thread Mangalani Peter Makananisa
HI all, Is it possible to use one column spread on multiple columns values. example spread( Key_col, value1:value7) spreading Key_col to variable value1, value2, ... Value7 Please advise, Kind regards Mangalani Peter Makananisa (5786) South African Revenue Service (SARS) - HO +2782 456

[R] dplyr help

2015-07-29 Thread Jon BR
Hello, I've recently discovered the helpful dplyr package. I'm using the 'aggregate' function as such: bevs - data.frame(cbind(name = c(Bill, Mary), drink = c(coffee, tea, cocoa, water), cost = seq(1:8), sex = c(male,female))); bevs$cost - seq(1:8) bevs name drink costsex 1 Bill

Re: [R] dplyr help

2015-07-29 Thread Jon BR
Hi Brian, Thanks for the suggestion, although the command is throwing an error as such: bevs %% group_by(name, sex, drink) %% summarise( cost = sum(cost)) %% select(name, drink, cost, sex) Error: unexpected input in bevs %% group_by(name, sex, drink) %% summarise( Your syntax is new to me

Re: [R] dplyr help

2015-07-29 Thread Jon BR
David, I do appreciate your help, if not the dose of contempt. I hope you feel OK. Thanks for the tips, -Jonathan On Wed, Jul 29, 2015 at 11:14 PM, David Winsemius dwinsem...@comcast.net wrote: On Jul 29, 2015, at 7:37 PM, Jon BR wrote: Hello, I've recently discovered the helpful

Re: [R] dplyr help

2015-07-29 Thread Brian Kreeger
​dplyr solution: bevs %% group_by(name, sex, drink) %% summarise(​cost = sum(cost)) %% select(name, drink, cost, sex) The last select statement puts the output in the column order you wanted in your result. I hope this helps. Brian On Wed, Jul 29, 2015 at 9:37 PM, Jon BR jonsle...@gmail.com

Re: [R] dplyr help

2015-07-29 Thread David Winsemius
On Jul 29, 2015, at 7:37 PM, Jon BR wrote: Hello, I've recently discovered the helpful dplyr package. I'm using the 'aggregate' function as such: The `aggregate` function is part of base-R: bevs - data.frame(cbind(name = c(Bill, Mary), drink = c(coffee, tea, cocoa, water), cost =