similar to: Help with Reshaping from Wide to Long

Displaying 20 results from an estimated 200 matches similar to: "Help with Reshaping from Wide to Long"

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 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
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
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
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
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 ? >
2011 Sep 07
1
Reshaping data from wide to tall format for multilevel modeling
Hi, I'm trying to reshape my data set from wide to tall format for multilevel modeling. Unfortunately, the function I typically use (make.univ from the multilevel package) does not appear to work with unbalanced data frames, which is what I'm dealing with. Below is an example of the columns of a data frame similar to what I'm working with: ID a1 a2 a4 b2 b3 b4 b5 b6 Below
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]]
2011 Apr 14
0
Reshaping and plotting tabular data
Hi- Tabular data have been provided to me within .csv files. I need to transform the data from tabular format into a dataframe with three columns. The columns need to be the table row id, table column id, and the tabulated variable. An example dataset can be downloaded here:
2011 Jun 15
1
Reshaping data with xtabs reorders my rows
Dear, I have a data frame melted from a list of matrices (melt from reshape package), then I impute some missing values and then want to tabulate the data again to the array (or list, doesn't matter) of matrices form. However when using xtabs function it orders my rows alphabetically and apparently doesn't take "reorder = FALSE" option or anything like it. Is there anything I
2010 Mar 29
2
Reshaping a data frame with a series of factors and 23 repeated measures
I have a data frame that I created using read.table on a csv spreadsheet. The data look like the following: Steer.ID stocker.trt Finish.trt Date Days Wt ...... Steer.Id, stocker.trt, Finish.trt are factors------ Date, Days, Wt are data that are repeated 23 times (wide format). I want to reshape the data such that I have the correct Steer.ID, stocker.trt, Finish.trt identifying all of
2008 Feb 15
2
For Subset or Reshaping the Table
Hi R users I am a new user in the field of R. I want to subset or reshape a data.frame. For example I have a matrix like A B C D E F G a 1 2 3 4 5 6 7 b 4 6 8 9 5 5 6 c 3 4 4 4 3 3 6 d 1 2 4 6 8 8 9 e 5 6 7 8 9 2 3 I want to reshape the matrix in this format Row Col Value a D 4 a E 5 a F 6 . . ..
2012 Jul 25
1
reshaping data
Hi, I am trying to reshape data from a long to wide format but have a specific task that I cannot get to output properly. # SAMPLE DATA; id <- c(1,2,2,3,3,3) time <-c(0,0,5, 0, 2, 10) x <- rnorm(length(id)) long <- data.frame(id,time,x) # To reshape, I would like to exclude 'id' values that have NO duplicate (i.e., remove # id=1 in this case). My attempts failed because the
2012 Aug 22
1
Reshaping dataframes
Hi, I have a data set with variables that are _not_ missing at random. Now I use a package for learning a Bayesian Network which won't accept NA as a value. From a database I query data.frames with k,k+n,k+2n, ... variables (there are always at least k variables as leftmost columns). Using rbind.fill from the reshape package on two data frames I would get a data frame like trg_type