ggplot2 melt function "value"

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ggplot2 melt function "value"

Felipe Carrillo
Hi:I recently started using the melt function and
found that it is very useful and powerful,however I
can't seem to find the way to change the default
column header "value" to my custom column name. Does
anyone know how to go about this? any suggestions are
very appreciated. Thanks

Felipe D. Carrillo
  Fishery Biologist
  US Fish & Wildlife Service
  California, USA



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.

______________________________________________
[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: ggplot2 melt function "value"

Dieter Menne
Felipe Carrillo <mazatlanmexico <at> yahoo.com> writes:

> Hi:I recently started using the melt function and
> found that it is very useful and powerful,however I
> can't seem to find the way to change the default
> column header "value" to my custom column name.

melted data are data frames. You can names[..]<-"myvalue" for renaming, but make
sure you don't need the column for reshaping afterwards.


Dieter

______________________________________________
[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: ggplot2 melt function "value"

hadley wickham
> > Hi:I recently started using the melt function and
> > found that it is very useful and powerful,however I
> > can't seem to find the way to change the default
> > column header "value" to my custom column name.
>
> melted data are data frames. You can names[..]<-"myvalue" for renaming, but make
> sure you don't need the column for reshaping afterwards.

In the next version of reshape, cast will default (with a message) to
using the last column of the data.frame if value and (all) columns are
not available.  This was a nice suggestion from Antony Unwin.

Hadley

--
http://had.co.nz/

______________________________________________
[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.