[R] data.table cant find function melt?

John Kane jrkrideau at inbox.com
Fri May 22 19:39:13 CEST 2015


Hi Ken,

This is strange but look at the example at ?melt , pick the data.table example not the reshape2 example.

It looks to me like data.table is using the reshape2 melt() 

Perhaps data.table used to load reshape2 but now you need to do it explicitly, or at least that's my guess.

John Kane
Kingston ON Canada


> -----Original Message-----
> From: knussear at mac.com
> Sent: Fri, 22 May 2015 10:26:03 -0700
> To: r-help at r-project.org
> Subject: [R] data.table cant find function melt?
> 
> Hi all, trying to use the melt function in data.table and I'm getting an
> error....
> 
> Anyone seen this before or know how to fix it?
> 
> Thanks
> 
> str(Distdata)
> 
> Classes ‘data.table’ and 'data.frame':	828451 obs. of  3 variables:
>  $ Poly1   : int  50088 50088 50088 50088 50088 50088 50088 50088 50088
> 50088 ...
>  $ Poly2   : int  44884 11542 11543 11540 11541 11546 11547 11544 11545
> 11548 ...
>  $ Distance: int  788641 3794345 3652511 3915074 3895469 3639175 3644151
> 3648356 3646023 3615863 ...
>  - attr(*, ".internal.selfref")=<externalptr>
> 
> 
> 
> melt.data.table(Distdata, id.vars=Poly1, measure.vars=Poly2)
> 
> Error: could not find function "melt.data.table"
> 
> melt(Distdata, id.vars=Poly1, measure.vars=Poly2)
> 
> Error: could not find function "melt"]
> 
> ______________________________________________
> R-help at 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.

____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!



More information about the R-help mailing list