[R] dplyr help

Mangalani Peter Makananisa pmakananisa at sars.gov.za
Tue Jul 11 09:56:45 CEST 2017

Thank you very much for the support.  I have just used the reshape library and my problem was solved.

Kind regards,


-----Original Message-----
From: Jeff Newmiller [mailto:jdnewmil at dcn.davis.ca.us] 
Sent: 10 July 2017 03:52 PM
To: r-help at r-project.org; Mangalani Peter Makananisa; r-help at r-project.org
Cc: Vito Ricci (vito_ricci at 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 data), the answer is no, the column names come from the column named by the key parameter and the values that fill those columns come from the column named by the value parameter. Modify your data frame to contain both columns before using this function.

When the function is used outside a pipe chain there is also the first argument, the data frame that is being reshaped.

Please post using plain text in the future... this is a plain text mailing list,  and HTML email is what-you-see-is-not-what-we-see.
Sent from my phone. Please excuse my brevity.

On July 10, 2017 1:29:41 AM PDT, Mangalani Peter Makananisa <pmakananisa at sars.gov.za> wrote:
>HI all,
>Is it possible to use one column spread on multiple columns values.
>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 4669 / +2712 422 7357
>Please Note: This email and its contents are subject to our email legal 
>notice which can be viewed at 
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

Please Note: This email and its contents are subject to our email legal notice which can be viewed at http://www.sars.gov.za/Pages/Email-disclaimer.aspx

	[[alternative HTML version deleted]]

More information about the R-help mailing list