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

Kind regards,

Peter

-----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 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 
<pmakanan...@sars.gov.za> wrote:
>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 4669 / +2712 422 7357
>
>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]]
>
>______________________________________________
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>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]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to