All,
I believe I am running the latest version of rshape2 (1.2.1). But this code:
library(reshape2)
tmp <- melt(smiths,
id.vars=1:2,
measure.vars=c("age","weight","height"),
variable.name="myvars",
value.name="myvals"
)
names(tmp)
Produces this output:
names(tmp)
[1] "subject" "time" "variable" "value"
So you can see that these lines of code don't work:
variable.name="myvars",
value.name="myvals"
Is this a bug?
David
--
View this message in context: http://r.789695.n4.nabble.com/rhsape2-bug-tp4637331.html
Sent from the R help mailing list archive at Nabble.com.
Hi David,
Your example works as expected for me (see sessionInfo below). What
version of R are you using? What other packages are loaded?
R version 2.15.1 (2012-06-22)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] reshape2_1.2.1
loaded via a namespace (and not attached):
[1] plyr_1.7.1 stringr_0.6 tools_2.15.1
Best,
Ista
On Sat, Jul 21, 2012 at 7:06 PM, darnold <dwarnold45 at suddenlink.net> wrote:
All,
I believe I am running the latest version of rshape2 (1.2.1). But this code:
library(reshape2)
tmp <- melt(smiths,
id.vars=1:2,
measure.vars=c("age","weight","height"),
variable.name="myvars",
value.name="myvals"
)
names(tmp)
Produces this output:
names(tmp)
[1] "subject" "time" "variable" "value"
So you can see that these lines of code don't work:
variable.name="myvars",
value.name="myvals"
Is this a bug?
David
--
View this message in context: http://r.789695.n4.nabble.com/rhsape2-bug-tp4637331.html
Sent from the R help mailing list archive at Nabble.com.
[1] ".GlobalEnv" "package:reshape" "package:plyr"
[4] "package:reshape2" "tools:rstudio" "package:stats"
[7] "package:graphics" "package:grDevices" "package:utils"
[10] "package:datasets" "package:methods" "Autoloads"
[13] "package:base"
Thanks.
D.
--
View this message in context: http://r.789695.n4.nabble.com/rhsape2-bug-tp4637331p4637337.html
Sent from the R help mailing list archive at Nabble.com.
Hi,
It works for me too.? When I had reshape and reshape2 both loaded, I had the same problem.?
?library(reshape2)
?tmp <- melt(smiths,
???? id.vars=1:2,
???? measure.vars=c("age","weight","height"),
???? variable.name="myvars",
???? value.name="myvals"
?)
?
?names(tmp)
[1] "subject" "time"??? "myvars"? "myvals"
#Now with reshape loaded.
library(reshape)
Loading required package: plyr
Attaching package: ?reshape?
The following object(s) are masked from ?package:plyr?:
??? rename, round_any
The following object(s) are masked from ?package:reshape2?:
??? colsplit, melt, recast
tmp <- melt(smiths,
????? id.vars=1:2,
????? measure.vars=c("age","weight","height"),
????? variable.name="myvars",
????? value.name="myvals"
? )
names(tmp)
[1] "subject"? "time"???? "variable" "value"??
A.K.
----- Original Message -----
From: darnold <dwarnold45 at suddenlink.net>
To: r-help at r-project.org
Cc:
Sent: Saturday, July 21, 2012 7:06 PM
Subject: [R] rhsape2 bug?
All,
I believe I am running the latest version of rshape2 (1.2.1). But this code:
library(reshape2)
tmp <- melt(smiths,
? ? id.vars=1:2,
? ? measure.vars=c("age","weight","height"),
? ? variable.name="myvars",
? ? value.name="myvals"
)
names(tmp)
Produces this output:
names(tmp)
[1] "subject"? "time"? ? "variable" "value"
So you can see that these lines of code don't work:
? ? variable.name="myvars",
? ? value.name="myvals"
Is this a bug?
David
--
View this message in context: http://r.789695.n4.nabble.com/rhsape2-bug-tp4637331.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help at r-project.org 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.
Check and see if you have reshape loaded as well. I had a somewhat similar problem (R2.13 ?) and realised that reshape was masking reshape2
John Kane
Kingston ON Canada
-----Original Message-----
From: dwarnold45 at suddenlink.net
Sent: Sat, 21 Jul 2012 16:06:11 -0700 (PDT)
To: r-help at r-project.org
Subject: [R] rhsape2 bug?
All,
I believe I am running the latest version of rshape2 (1.2.1). But this
code:
library(reshape2)
tmp <- melt(smiths,
id.vars=1:2,
measure.vars=c("age","weight","height"),
variable.name="myvars",
value.name="myvals"
)
names(tmp)
Produces this output:
names(tmp)
[1] "subject" "time" "variable" "value"
So you can see that these lines of code don't work:
variable.name="myvars",
value.name="myvals"
Is this a bug?
David
--
View this message in context:
http://r.789695.n4.nabble.com/rhsape2-bug-tp4637331.html
Sent from the R help mailing list archive at Nabble.com.
____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!