Create a Pivot

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Create a Pivot

namit
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Create a Pivot

David Carlson
Can you be more specific? Make up a small data set and show us what you
want. Use dput(dataset) to produce a version that is easy to paste into
your message. Pivot could mean many things. Transpose? Cross tabulate (as in
Excel)? Aggregate (again Excel)? Principal axes?

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352



> -----Original Message-----
> From: [hidden email] [mailto:r-help-bounces@r-
> project.org] On Behalf Of namit
> Sent: Tuesday, July 24, 2012 12:53 PM
> To: [hidden email]
> Subject: [R] Create a Pivot
>
> Hi Friends,
>
> i'm new to R....I have data frame  having columns  X Y Z....I want to
> do
> pivot on this data frame....can any one help me on this...
>
> Thanks,
> Namit
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Create-a-
> Pivot-tp4637629.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> 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.

______________________________________________
[hidden email] mailing list
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 | Threaded
Open this post in threaded view
|

Re: Create a Pivot

jholtman
In reply to this post by namit
Define what you mean by a pivot.  I know what a pivot table in Excel
is and you can easily create the equivalent one in R, but you have
supplied no data and have not indicated what you want as output in the
"cells" of the pivot table -- e.g., counts, sums percentages, etc.
You need to show some data and then what you would expect as output.

On Tue, Jul 24, 2012 at 1:52 PM, namit <[hidden email]> wrote:

> Hi Friends,
>
> i'm new to R....I have data frame  having columns  X Y Z....I want to do
> pivot on this data frame....can any one help me on this...
>
> Thanks,
> Namit
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Create-a-Pivot-tp4637629.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> 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.



--
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

______________________________________________
[hidden email] mailing list
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 | Threaded
Open this post in threaded view
|

Re: Create a Pivot

namit
This post has NOT been accepted by the mailing list yet.
In reply to this post by namit
Hi Friends,
 

i Have a data frame :

xxx  having  columns      color    name  values
                                                  R          XXX     10
                                                  G          YYY      4
                                                  Y           ZZZ      5
                                                  G          XXX     2        
                                                    Y         XXX     3
                                                   R          YYY      2
                                                   Y          YYY       1
                                                   R         ZZZ       2
                                                   G         ZZZ       3


Now i want to have the data  in this format               R    G    Y

                                                                                   XX X       10   2     3
                                                                                     YYY         2    4     1
                                                                                    ZZZ          2   3      5

C a you please help me on this.


Thanks,
Namit