Oops, that should have been:
stretch_df(tadf,"V1","V2")
Jim
On Thu, Jul 6, 2017 at 8:38 AM, Jim Lemon wrote:
> Hi Tom,
> Or perhaps:
>
> #assume the data frame is named "tadf"
> library(prettyR)
> stretch_df(tadf,1,2)
>
> Jim
>
>
> On Thu, Jul 6, 2017 at 6:50 AM, Ista Zahn wrote:
>> The reason
Hi Tom,
Or perhaps:
#assume the data frame is named "tadf"
library(prettyR)
stretch_df(tadf,1,2)
Jim
On Thu, Jul 6, 2017 at 6:50 AM, Ista Zahn wrote:
> The reason it doesn't work easily with reshape/reshape2 is that the
> order of the rows is not determined. Your answer could be
>
> 1957
The reason it doesn't work easily with reshape/reshape2 is that the
order of the rows is not determined. Your answer could be
1957 1958 ... 1985 1986
0.8625000 0.750 ... 0.7307692 0.2375
0.0733945 0.6435644 ...NA 0.05769231
0.5096154NA ...NA 0.6
NANA
>
> -
> David L Carlson
> Department of Anthropology
> Texas A&M University
> College Station, TX 77840-4352
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Thomas
&
:17 PM
To: r-help@r-project.org
Subject: [R] Help with reshape/reshape2 needed
Hi all:
I'm struggling with getting my data re-formatted using functions in
reshape/reshape2 to get from:
1957 0.86250
1958 0.75000
1959 0.3
1960 0.28750
1963 0.67500
1964 0.93750
19
Hi all:
I'm struggling with getting my data re-formatted using functions in
reshape/reshape2 to get from:
1957 0.86250
1958 0.75000
1959 0.3
1960 0.28750
1963 0.67500
1964 0.93750
1965 0.02500
1966 0.38750
1969 0.08750
1970 0.27500
1973 0.5
1974
ra; R list
Subject: Re: [R] help with reshape
I don't think it is platform or version specific. The purpose of the
missing value, NA (i.e. Not Available), is to flag the value for
special handling in some way, often by deletion. You cannot assume that
NA will be treated as any other value since
Of David L
> Carlson
> Sent: Tuesday, September 08, 2015 5:03 PM
> To: Ivan Calandra; R list
> Subject: Re: [R] help with reshape
>
> I don't think it is platform or version specific. The purpose of the
> missing value, NA (i.e. Not Available), is to flag the value for
>
2015 9:33 AM
To: R list
Subject: Re: [R] help with reshape
David,
It seems that your solution works, but why would that be? And why would
this NA behavior be platform or version specific?
I really need to check with a newer version of R...
Ivan
--
Ivan Calandra, PhD
University of Reims Cham
, TX 77840-4352
Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ivan Calandra
Sent: Tuesday, September 8, 2015 7:56 AM
To: PIKAL Petr; R list
Subject: Re: [R] help with reshape
Thanks Petr,
It looks good, but I have to check in more details.
Can anyone he
pe().
-
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352
Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ivan Calandra
Sent: Tuesday, September 8, 2015 7:56 AM
To: PIKAL
08, 2015 3:25 PM
To: PIKAL Petr; R list
Subject: Re: [R] help with reshape
I do get only 2 lines:
mydata <- structure(list(ID = c(543, 544, 545, 546, 547, 548, 549, 550,
551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 11574,
11575, 11576, 11577, 11578, 11579, 11580, 11581, 11
result, though.
Cheers
Petr
> -Original Message-
> From: Ivan Calandra [mailto:ivan.calan...@univ-reims.fr]
> Sent: Tuesday, September 08, 2015 3:25 PM
> To: PIKAL Petr; R list
> Subject: Re: [R] help with reshape
>
> I do get only 2 lines:
>
> mydata <-
1667,
291.93333333, NA), Moyenne.Ca3158 = c(578.2, 278.8333,
NA), Moyenne.Cd2288 = c(0.1514, 0.819, NA), Moyenne.Co2286 = c(NA_real_,
NA_real_, NA_real_), Moyenne.Co2378 = c(1.87225, 3.946, NA
), Moyenne.Cr2055 = c(NA_real_, NA_real_, NA_real_), Moyenn
890 = c(NA, NA, NA,
3.9615), As1937 = c(3.7455, NA, 2.2755, 3.488333), Ca1840 =
c(596.1667,
NA, 291.9333, 337.4333), Ca3158 = c(578.2, NA,
278.8333, 323.5333), Cd2288 = c(0.1514, NA, 0.819,
0.87716666667), Co2286 = c(NA, NA, NA, 0.2924667),
ur solution as I use reshape only sparsely.
Cheers
Petr
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ivan
Calandra
Sent: Tuesday, September 08, 2015 2:18 PM
To: R list
Subject: Re: [R] help with reshape
Thank you Petr,
It kinda works, but not comple
m: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ivan
> Calandra
> Sent: Tuesday, September 08, 2015 2:18 PM
> To: R list
> Subject: Re: [R] help with reshape
>
> Thank you Petr,
>
> It kinda works, but not completely. The problem is that it produces a
> column
--Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ivan
Calandra
Sent: Tuesday, September 08, 2015 12:33 PM
To: R list
Subject: [R] help with reshape
Dear users,
I'm having troubles with reshaping a data.frame from long to wide
format.
I copy the output of d
-(1:5)], "_"), "[",
1)), sep=".")
names(test)[-(1:5)]<-nn
Cheers
Petr
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ivan
> Calandra
> Sent: Tuesday, September 08, 2015 12:33 PM
> To: R list
> Subje
Dear users,
I'm having troubles with reshaping a data.frame from long to wide format.
I copy the output of dput() at the end of the mail because it is quite long.
Each row of the column "Elem" should be transposed to a new column. All
variables "Etape", "Ech", "repet", "dilution", "Rincage" def
thank you very much for such a thorough solution!
--
View this message in context:
http://r.789695.n4.nabble.com/help-with-reshape-is-needed-again-tp2260640p2260943.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
Hi:
# Method 1: Transposition and name corrections
> dd <- read.table(textConnection("
+ gene1 breast 10100 1
+ gene2 breast 20200 4
+ gene3 breast 3050 5
+ gene4 breast 40400 9"))
> cl
hi, folks:
i need to transpose the following data:
genetissuepatient1 patient2 patient3.
-
gene1 breast 10100 1
gene2 breast 20200 4
gene3 breast 3050
To all of you who answered me: Thank you so much!
Each approach taught me something new and I really appreciate your help!
Best regards,
Dana Sevak
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the pos
Hi Dana,
> -- Forwarded message --
> From: Dana Sevak
> To: r-help@r-project.org
> Date: Tue, 12 May 2009 23:02:00 -0700 (PDT)
> Subject: [R] Help with reshape/reShape and indexing
>
> Dear R Helpers,
>
> I have trouble applying reShape and
> This does it more or less your way:
>
> ds <- split(df, df$Name)
> ds <- lapply(ds, function(x){x$Index <- seq_along(x[,1]); x})
> df2 <- unsplit(ds, df$Name)
> tapply(df2$X1, df2[,c("Name", "Index")], function(x) x)
>
> athough there may exist much easier ways ...
Here's one way with the plyr a
Try this:
DF$Index <- ave(1:nrow(DF), DF$Name, FUN = seq_along)
reshape(DF[-3], dir = "wide", idvar = "Name", timevar = "Index")
Also see the reshape package for another similar facility.
On Wed, May 13, 2009 at 2:02 AM, Dana Sevak wrote:
>
> Dear R Helpers,
>
> I have trouble applying reShap
one way is the following:
df.index <- df
df.index$Index <- ave(seq_along(df$Name), df$Name, FUN = seq_along)
df.index
df2 <- reshape(df.index[c("Name", "Index", "X1")], timevar = "Index",
idvar = "Name", direction = "wide")
df2
I hope it helps.
Best,
Dimitris
Dana Sevak wrote:
Dear R Hel
Dana Sevak wrote:
Dear R Helpers,
I have trouble applying reShape and reshape although I read the documentation
and several posts, so I would very much appreciate your help on the two points
below.
I have a dataframe
df = data.frame(Name=c("a", "a", "a", "b", "b", "c"), X1=c("12", "13", "1
Dear R Helpers,
I have trouble applying reShape and reshape although I read the documentation
and several posts, so I would very much appreciate your help on the two points
below.
I have a dataframe
df = data.frame(Name=c("a", "a", "a", "b", "b", "c"), X1=c("12", "13", "14",
"20", "25", "30"
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
31 matches
Mail list logo