://user/SendEmail.jtp?type=nodenode=4654269i=2
Cc:
Sent: Friday, December 28, 2012 2:02 AM
Subject: Re: [R] help with reshaping wide to long format
Hi, Sorry, but how did you bring it out?
Thanks
On Fri, Dec 28, 2012 at 8:48 AM, arun kirshna [via R]
[hidden email] http://user/SendEmail.jtp
other
variables and select the best model based on different criteria.
Happy New Year!
A.K.
From: Usha Gurunathan usha.nat...@gmail.com
To: arun smartpink...@yahoo.com
Sent: Sunday, December 30, 2012 7:15 AM
Subject: Re: [R] help with reshaping wide
:
Sent: Friday, December 28, 2012 2:02 AM
Subject: Re: [R] help with reshaping wide to long format
Hi, Sorry, but how did you bring it out?
Thanks
On Fri, Dec 28, 2012 at 8:48 AM, arun kirshna [via R]
ml-node+s789695n4654093...@n4.nabble.com wrote:
Hi,
bp.sub- structure(list(CODEA = c(1L, 3L, 4L
) and An introduction to R (the
link will be in the posting guide).
A.K.
- Original Message -
From: usha2013 usha.nat...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Friday, December 28, 2012 2:02 AM
Subject: Re: [R] help with reshaping wide to long format
Hi, Sorry, but how did you
On Sun, Jul 18, 2010 at 6:44 PM, jlwoodard john.wood...@wayne.edu wrote:
Hi Phil and Jeff,
Thanks so much for taking the time to help me solve this issue! Both
approaches work perfectly. Each of your approaches helped me learn more
about what R can do. I really appreciate your help!
Hi Phil and Jeff,
Thanks so much for taking the time to help me solve this issue! Both
approaches work perfectly. Each of your approaches helped me learn more
about what R can do. I really appreciate your help!
Very best regards,
John
--
View this message in context:
I am trying to reshape data that are in the wide format into the long format.
The design is a repeated-measures design, which combined 3 levels of shape
(circle, square, triangle) with 3 levels of color (Blue, Red, Green), for a
total of 9 variables. The wide data look like this (sorry I
Hi John,
1) Read the help for the reshape package. What you want is to use the
melt function.
2) There are various ways of doing Repeated measures Anova in R, you might
want to have a look at this:
http://www.r-statistics.com/2010/04/repeated-measures-anova-with-r-tutorials/
(I especially like
Tal,
Thanks for the information.
I actually did read through the help for the reshape package, though being
relatively new to R, I don't quite understand the ins and outs of the
command.
I tried using the melt command:
x-melt(accuracy,id='Subject')
but, it didn't give me anything different
Hi John,
Try posting a sample of your data in reply to this e-mail by using:
dput(head(accuracy))
And me (or someone else) will be sure to fix your command.
Regarding the ANOVA, read more :)
Tal
Contact
Details:---
Contact
Hi Tal,
Here is the output as you requested:
structure(list(Subject = c(101L, 102L, 103L, 104L, 105L, 106L
), CircleBlue = c(95L, 80L, 80L, 85L, 70L, 70L), CircleRed = c(100L,
90L, 70L, 80L, 75L, 75L), CircleGreen = c(100L, 100L, 95L, 100L,
95L, 75L), SquareBlue = c(95L, 85L, 90L, 90L, 70L,
Try this:
library(reshape)
accuracy - structure(list(Subject = c(101L, 102L, 103L, 104L, 105L, 106L
), CircleBlue = c(95L, 80L, 80L, 85L, 70L, 70L), CircleRed = c(100L,
90L, 70L, 80L, 75L, 75L), CircleGreen = c(100L, 100L, 95L, 100L,
95L, 75L), SquareBlue = c(95L, 85L, 90L, 90L, 70L, 40L),
An alternative using the base reshape function:
one =
reshape(accuracy,idvar='Subject',varying=list(c(2,3,4),c(5,6,7),c(8,9,10)),
direction='long',timevar='shape')
two = reshape(one,idvar=c('Subject','shape'),varying=list(3:5),
direction='long',timevar='color')
]
Sent: Monday, August 03, 2009 4:57 PM
To: David Reiner dav...@rhotrading.com
Cc: R-help@r-project.org
Subject: Re: [R] Help with reshaping data.frame
On Mon, Aug 3, 2009 at 5:23 PM, dav...@rhotrading.com wrote:
I'm having trouble reshaping a data.frame from long to wide.
(I think that's the right
I'm having trouble reshaping a data.frame from long to wide.
(I think that's the right terminology; feel free to educate me.)
I've looked at the reshape function and package and plyr package,
but I can't quite figure out how to do this after a dozen variations.
I have a data.frame with more
message -
From: dav...@rhotrading.com
To: R-help@r-project.org
Date: Mon, 3 Aug 2009 16:23:22 -0500
Subject: [R] Help with reshaping data.frame
I'm having trouble reshaping a data.frame from long to wide.
(I think that's the right terminology; feel free to educate me.)
I've looked at the reshape
On Mon, Aug 3, 2009 at 5:23 PM, dav...@rhotrading.com wrote:
I'm having trouble reshaping a data.frame from long to wide.
(I think that's the right terminology; feel free to educate me.)
I've looked at the reshape function and package and plyr package,
but I can't quite figure out how to do
Try this:
tst2 - tst[-(2:3)]
tst2$timevar - with(tst, interaction(K2, K3))
reshape(tst2, dir = wide, idvar = K1, timevar = timevar)
K1 V1.D.a V2.D.a V3.D.a V1.E.a V2.E.a V3.E.a V1.D.b V2.D.b V3.D.b
V1.E.b V2.E.b V3.E.b
1 10 0.08 99105 NA NA NA NA 76775
0.11
hi Im having some problems reshaping
Ive managed to apply it but have some problems
the attached document will explain
any help is appreciated
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
MCI
A1
A2
A13
A14
A23
A24
A33
A34
Grouped together
56766
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
6459
N/A
try this:
x[6, which(x[5,]==y)] - y
levels(x$id) - c(levels(x$id)[drop=T], treat)
x - x[-5,]
x[5, id] - treat
levels(x$id) - gsub(^ques, , levels(x$id))
x3 - as.data.frame(t(x[,-1]))
names(x3) - x$id
foo - function(x, ...)
{
tmp - as.numeric(as.character(unlist(x[,grep(_, names(x), value=T)])))
Dear list,
I have the following data set
id 1 2 3 4 5 6 7 8 9 10
disease a b c d e f g h i j
age 23 40 32 34 25 32 22 35 29 21
cityNY LD NY SG NY LD VG SA LD SG
sex 1 1 2 2 2 2 1 1 1 2
treat_a y y yy
treat_b n n
22 matches
Mail list logo