similar to: reshaping data

Displaying 20 results from an estimated 500 matches similar to: "reshaping data"

2011 Jun 14
1
Renaming variables
Hi guys, I checked previous posts and I saw similar questions have been answered; they didn't help me solve my problem though. I am using R version 2.13.0 (2011-04-13), Platform: x86_64-pc-mingw32/x64 (64-bit) and I am having difficulties renaming variables. I tried with this command: names (oldvariable) <- 'new_variable' and now when I type in oldvariable the new name pops out
2004 Sep 30
1
expand.model.frame gives "object not found"
Hello, I am a (relatively) experienced programmer, but new to R. I have a problem using R 1.9.1. I have fit some data using glm(), from within a function: formula = as.formula(paste(depvarname, "~", rhs), env=globalenv()) return (glm(formula, family=binomial(link=logit))) I have now come back to the formula and want to add some more variables to it. So I do:
2010 Jan 28
2
Data.frame manipulation
Hi All, I'm conducting a meta-analysis and have taken a data.frame with multiple rows per study (for each effect size) and performed a weighted average of effect size for each study. This results in a reduced # of rows. I am particularly interested in simply reducing the additional variables in the data.frame to the first row of the corresponding id variable. For example:
2016 Apr 27
0
R Script Template
The subject of your email is missing. Perhaps you need to read the Posting Guide (again?) about attachments. Embedding your example directly in the body of the email is generally more accessible in archives than attaching it. -- Sent from my phone. Please excuse my brevity. On April 27, 2016 1:14:17 PM GMT+01:00, G.Maubach at gmx.de wrote: >Hi All, > >I am addressing this post to all
2016 Apr 27
2
R Script Template
Hi All, I am addressing this post to all who are new to R. When learing R in the last weeks I took some notes for myself to have code snippets ready for the data analysis process. I put these snippets together as a script template for future use. Almost all of the given command prototypes are tested. The template script contains snippets for best practices and leaves out the commands that
2005 Sep 01
4
Spacing and margins in plot
If I use the following command to plot points: plot(c(1,2,2,3,3,3), type="p", pch=20, ylab="Y Label", xlab="X Label", xaxt="n") there is a large amount of space between the label "X Label" and the actual x-axis. If I change the xaxt="n" to xaxt="s", the label "X Label" don't move at all. Is there a way to get
2005 Mar 18
3
extract rows in dataframe with duplicated column values
Hi I want to extract all the rows in a data frame that have duplicates for a given column. I would expect this question to come up pretty often but I have researched the archives and surprisingly couldn't find anything. The best I can come up with is: x <- data.frame(a=c(1,2,2,3,3,3), b=10) xdup1 <- duplicated(x[,1]) xdup2 <- duplicated(x[,1][nrow(x):1])[nrow(x):1] xAllDups <-
2011 Feb 24
1
reshaping list into a contingency table
Hi all, I have been struggling with this problem for a few days. I have a data table like this: gene rpkm1 diff1 rpkm2 diff2 gene1 23 50 13 120 gene2 111 220 827 1200 gene3 75 998 71 910 And I want to re-format it so that, for each gene, I have a 2x2 contingency table, such as: gene rpkm diff gene1 23 50 gene1 13 120 gene2 111 220 gene2 827
2012 Jun 09
2
Reshaping columns
Dear all, I have a data frame with 2 columns and 102500 rows. The data looks like below V1 V2 8098 110000....... 9099 001100....... 0023 110011....... 6545 111111....... . . . . . . . . . . I want to split the colums like this ; V1 V2 V3 V4 V5 V6 v7 8098 1 1 0 0 0 0 ...... 9099
2003 Oct 30
1
Trouble reshaping some data
I would appreciate some advice on the following task. I have some data that currently looks like this: t1 <- data.frame(id=c(1,1,2,2), aspect=c("A","B","A","B"), score=c(10,9,11,12)) I'd like it to look like this: id A B 1 10 9 2 11 12 reshape() looks like a good candidate for this job but I'm not really sure about the roles of
2012 Mar 13
1
reshaping a dataset for a network
dear all, apologizes for bothering with a probably stupid question but I really don' t know how to proceed. I have a dataset which look like df a <- c(1,2,3,4,4,4,5,5) b <- c(11,7,4,9,8,3,12,4) df <-cbind(a,b) I would like to have one which looks like this: a 1 11 2 7 3 4 4 9 8 3 5 12 4 a are vertex of a network, b the edges. In the data the lenght of a is about 50000 I read
2010 Jul 21
2
Issues reshaping data
Hello All, I'm having some trouble reshaping my data from wide to long format. I have tried using both the reshape function and package. Although I haven't worked much with the reshape function, I have found the reshape package useful and intuitive for reshaping data from long to wide format. However, going the other way has me stumped with this type of data. My data is set up, roughly,
2012 Nov 17
3
Reshaping a dataframe
Seems like this should be easy but I'm struggling a bit. How do I rearrange a data frame to go from the first one to the second shown below ? State Date lbs TX 200701 400 TX 200702 650 TX 200703 950 TX 200704 1000 FL 200701 200 FL 200702 300 FL 200703 500 FL 200704 333 NJ 200701 409 NJ 200702 308 NJ 200703 300 NJ 200704 800 Date TX FL NJ 200701 400 200 409 200702 650
2007 Jul 13
1
help with handling replicates before reshaping data
Dear list, I have a dataset consists of duplicated sequences within day for each patient (see below data) and I want to reshape the data with patient as time variable. However the reshape function only takes the first sequence of the replicates and ignores the second. How can I 1) average the duplicates and 2) give the duplicated sequences unique names before reshaping the data ? >
2009 Feb 13
0
help with reshaping (no file attached)
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 N/A N/A N/A N/A N/A N/A N/A N/A 31233
2016 Apr 21
0
Data reshaping with conditions
In R, square brackets [] are called "extraction operators" as they are interpreted so as to "extract" the parts of an object specified by the information within them. Your message contained only part of the line below: AltB<-svdatstr[row,indicesA][svdatstr[row,indicesA]<svdatstr[row,"maxB"]] Extraction operators may be specified sequentially or nested. Both
2009 Jun 01
1
Reshaping Data
Hi, i did a mistake with my first post. I have to reshape data from this matrix: id x1 x2 x3 x4 day1 day2 day3 day4 day5 day6 day7 day8 day9 1 0.129 0.797 0.231 0.615 4 4 1 1 1 1 3 3 3 2 0.420 0.376 0.501 0.282 4 4 4 4 5 4 2 5 5 3 0.377 0.486
2006 Feb 13
2
reshaping data
Hello, I have data in a frame: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 I would like them arranged in a single column: 1 2 3 4 . . 8 9 . . 16 etc. I believe this should be possible using reshape, but I can't see how to do it. Thanks for sparing time to help a neophyte, Roger Mason
2009 Nov 24
1
reshaping data
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091125/5ce76d9b/attachment-0001.pl>
2010 Mar 31
2
reshaping data
Hi All, Can someone help me reshape following data: Var1 Var2 Val A X 1 A Y 2 A Z 3 B X 4 B Y 5 B Z 6 to some kind of matrix/tabular format (preferably as a matrix), may be like Var1 X Y Z A 1 2 3 B 4 5 6 Any help would be greatly appreciated, Kim [[alternative HTML version deleted]]