similar to: how to reshape the data.frame from long to wide in a specific order

Displaying 20 results from an estimated 10000 matches similar to: "how to reshape the data.frame from long to wide in a specific order"

2011 Mar 22
1
how to convert a data.frame to a list of dist objects for individual differences MDS?
I have a 45 x 16 data frame consisting of dissimilarities among 10 colors, giving in each column the 45 = 10*9/2 pairwise judgments for one of 16 subjects. The rownames identify each pair of colors, e.g, "AC" = ("A","C"), and the pairs are ordered by columns in the lower triangle of each distance matrix. > helm.raw <-
2007 Aug 09
2
Systematically biased count data regression model
Dear all, I am attempting to explain patterns of arthropod family richness (count data) using a regression model. It seems to be able to do a pretty good job as an explanatory model (i.e. demonstrating relationships between dependent and independent variables), but it has systematic problems as a predictive model: It is biased high at low observed values of family richness and biased low at
2012 Mar 08
6
how to modify the tickment of x-axis
hi I plot a series of observation data every minutes in a day as the attachment below plot(wnd,type='l',lty=1,col='red',lwd=1,xlab=xxlab,ylab=yylab,ylim=YY) In the figure, the x-axis tickment is the number of data How can I change it fore example 1h 2h 3h 4h and so on ? -- TANG Jie Email: totangjie at gmail.com Tel: 0086-2154896104 Shanghai Typhoon Institute,China
2013 Jul 20
1
how to calculate the average values of each row in a matrix
Hello, I have a matrix (class matrix) composed of GridCell (row and column). The matrix value is the beta diversity index value between two grids. Now I would like to get the average value of each GridCell. Please kindly advise how to make the calculation. Thank you. Elaine The matrix looks like (cited from Michael Friendly) I would like to get the average value of each color. Obs
2013 Feb 15
3
datos climáticos cambio de formato
Hola!! tengo un data.frame donde cada fila corresponde a un año y cada columna a un mes (De enero a diciembre) > head(valT) V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 1941 18.0 16.3 15.2 10.1 8.1 8.3 8.8 9.2 7.9 12.2 11.9 14.6 1942 17.2 15.9 13.6 11.6 8.7 6.2 6.4 7.2 9.7 12.0 14.1 16.7 1943 17.6 17.3 13.5 12.5 10.5 7.0 8.2 7.9 -999.9 -999.9
2006 Sep 18
2
problems in sourcing R script
Dear list, First my information: platform i386-pc-linux-gnu arch i386 os linux-gnu system i386, linux-gnu status major 2 minor 3.1 year 2006 month 06 day 01 svn rev 38247 language R version.string Version 2.3.1 (2006-06-01) Now my question: How is it possible that a command in an R script is not
2007 Jul 28
1
Error when using the cat function
Is the following developed in my console output a recognized bug or am I using the cat function incorrectly? Thanks, Stan > ifelse(class(data[[n]])!="factor",{print("yes")},{print("no")}) [1] "yes" [1] "yes" > ifelse(class(data[[n]])!="factor",{cat("yes")},{cat("no")}) yesError in ans[test & !nas] <-
2008 Mar 04
2
summarizing replicates with multiple treatments
I have a dataframe with several different treatment variables, and would like to calculate the mean and standard deviation of the replicates for each day and treatment variable. It seems like it should be easy, but I've only managed to do it for one treatment at a time using subset and tapply. Here is an example dataset: > `exampledata` <- structure(list(day = c(1L, 1L, 1L, 1L, 1L,
2004 Nov 28
1
Could anyone help me reshape this "wide" data into "longitudinal" one? Thanks
Dear R people, I have a matrix like this: var1 var2 var3 var4 a1 7.1 7.2 8.1 8.2 a2 10.5 10.6 ... ... a3 b1 b2 b3 b4 c1 c2 ... The matrix row names are "a1", "a2", ...... and the matrix column names are "var1", "var2", "var3" and "var4". Now I want to reshape this data into a
2007 Apr 19
4
hello
ok how can I do to cancel le function factor for the moment ican't do this and I'm stuck with my problem for exemple Id_Rep Id_Geno Val_O Id_TrT1 1 1 64238 145 2 2 1 64238 1 1 3 1 64238 2 1 4 1 64238 1 1 5 1 64238 1 1 6 1 64238 2 1 7 1 64238 1 1 8 2
2013 Jan 03
2
Sas by function in R
Hello, It's an alternative to use SAS by function in R? I want to plot d histograms by plot.from example bellow: Thank you! plot d 1 1 16.3 2 1 25.0 3 1 57.8 4 1 17.0 5 2 10.8 13 2 96.4 17 3 76.0 18 3 32.0 19 3 11.0 20 3 11.0 24 3 106.0 25 3 12.5 21 4 19.3 22 4 12.0 26 4 15.0 27 5 99.3 32 7 11.0 36
2003 Jul 15
7
Excel can do what R can't?????
Hi there I thought this would be of particular interest to people using 'optim' functions and perhaps people involved with R development. I've been beaten down by R trying to get it to perform an optimization on a mass-balance model. I've written the same program in excel, and using the 'solver' function, it comes up with an answer for my variables (p, ACT, which
2012 Jul 06
4
differences between survival models between STATA and R
Dear Community, I have been using two types of survival programs to analyse a data set. The first one is an R function called aftreg. The second one an STATA function called streg. Both of them include the same analyisis with a weibull distribution. Yet, results are very different. Shouldn't the results be the same? Kind regards, J -- View this message in context:
2010 Aug 10
4
matrix problem
Hi, I have a file like this: 1 2 0.1 2 3 0.2 3 1 0.3 And I want to read it to create a matrix like this: [,1] [,2] [,3] [1,] 0 0.1 0 [2,] 0 0 0.2 [3,] 0.3 0 0 How can I do it efficiently? Thanks. -- Best, Zhenjiang [[alternative HTML version deleted]]
2010 Nov 10
1
ggplot2 problem in interacting mode
Hi all, When running R interactively, I have the problem as following: > library(ggplot2) Loading required package: reshape Loading required package: plyr Attaching package: 'reshape' The following object(s) are masked from 'package:plyr': round_any Loading required package: grid Loading required package: proto > data(VADeaths) > pg <- ggplot(melt(VADeaths),
2010 Sep 15
1
Format Data Issue??
R Users, I am new to R and have tried to figure out how to automate this process instead of using excel. I have read in this dataframe into r with read.table. I need to reshape the data from the first table into the format of the second table. TractID StandID Species CruiseDate DBHClass TreesPerAcre Carbon Stand 1 Loblolly Pine 5/20/2010 10 1.2 Carbon Stand 1 Loblolly Pine
2012 Dec 28
3
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+s789695n4654093h10@n4.nabble.com> wrote: > Hi, > bp.sub<- structure(list(CODEA = c(1L, 3L, 4L, 7L, 8L, 9L, 10L, 11L, 12L, > 13L, 14L, 16L, 17L), C45 = c(NA, 2L, 2L, 2L, 2L, 1L, NA, 1L, > 1L, 2L, 1L, 2L, 1L), ragek = c(3L, 3L, 3L, 4L, 4L, 3L, 3L, 3L, > 3L, 3L,
2009 Nov 26
1
lattice --- different properties of lines corresponding to type=c("l", "a") respectively
I think the subject says it all. I want to make a simple lattice plot, using xyplot with the argument type=c("l","a"). The problem then is that in the resulting plot it is difficult/impossible to see which plot corresponds to the average and which to the individual profiles. I triedthings like extra arguments lwd=c(1,3) or col=c("blue","red") hoping
2011 Oct 29
1
How to plot survival data from multiple trials (simulations)?
Dear all: Could anyone please provide some R codes to plot the below survival data to compare two groups (0 vs 1) after 2 simulations (TRL)? need 95% prediction interval on the plot from these 2 trials. I would like to simulate 1000 trials later. Thanks a lot for your great help and consideration! yan TRL ID ECOG BASE PTR8 GROUP POP ST ind 1 1 1 1 2.2636717 0.255634126 1 1 99.4 F 3 1 2 1
2010 May 18
25
Very serious performance degradation
Hi, I''m running Opensolaris 2009.06, and I''m facing a serious performance loss with ZFS ! It''s a raidz1 pool, made of 4 x 1TB SATA disks : zfs_raid ONLINE 0 0 0 raidz1 ONLINE 0 0 0 c7t2d0 ONLINE 0 0 0 c7t3d0 ONLINE 0 0 0 c7t4d0 ONLINE 0 0