similar to: how to transpose a dataframe

Displaying 20 results from an estimated 30000 matches similar to: "how to transpose a dataframe"

2011 Feb 03
3
R Data Manipulation - Transposing Data by a Given Column, Like User_ID
Hello, I'd like to transpose data to create an analysis-friendly dataframe. See below for an example, I was unable to use t(x) and I couldn't find a function with options like PROC TRANSPOSE in SAS. The ideal solution handles variable quantities of SITE - but beggars can't be choosers. :-) Thank you in advance, Mike ## INPUT DATA USER_ID<-c(1,1,1,2,2,2,3,3,4) SITE
2003 Sep 29
4
Data frame transpose
Hi All, I want to ask if there is a transpose function for data frame like the procedure of transpose in SAS? Because I want to partially transpose a data frame which contains 5 columns (siteid, date, time, obs, mod), what I want to do is to put time as the column variables along with siteid, and date, and put obs and mod in the row names. specifically to transpose a data frame: siteid date
2009 Sep 28
6
SAS user now converting to R - Help with Transpose
I am just starting to code in R and need some help as I am used to doing this in SAS. I have a dataset that looks like this: Chemical Well1 Well2 Well3 Well4 BOD 13.2 14.2 15.5 14.2 O2 7.8 2.6 3.5 2.4 TURB 10.2 14.6 18.5 17.3 and so on with more chemicals.... I would like to transpose my data so that it looks like this: Chemical WellID Value BOD Well1 13.2 BOD Well2 14.2 BOD Well3 15.5 BOD
2012 Mar 20
2
Reshaping data from long to wide without a "timevar"
Hello All, I was wondering if it's possible to reshape data from long to wide in R without using a "timevar". I've pasted some sample data below along with some code. The data are sorted by Subject and Drug. I want to transpose the Drug variable into multiple columns in alphabetical order. My data have a variable called "RowNo" that functions almost like a
2002 Jun 28
1
Transpose a dataframe
Hello, I would like to switch this dataframe: > k country 1960 1961 1962 1963 99 ARG 7493 7733 7581 7108 246 AUS 10484 10342 10809 11357 295 AUT 7438 7808 7938 8212 393 BDI 587 502 555 608 442 BEL 8223 8638 9021 9311 in this structure: year ARG AUS AUT BDI BEL 1960 7493 10484 7438 587 8223 1961 7733 10342 7808 502 8638 1962 7581 10809 7938 555
2009 Aug 18
4
Transpose a dataset
Hi Everyone, I have a dataset like this mean sd 0% 25% 50% 75% 100% n BODY TEMPERATURE 36.41099 0.4015699 35.1 36.22222 36.5 36.66667 37.1 89 DIASTOLIC BLOOD PRESSURE 73.60079 9.4656186 50.0 67.00000 73.0 80.00000 95.0 253 HEIGHT 171.94000 9.2011670 153.5 166.50000 173.0 176.25000 190.0
2008 Aug 25
3
Maintaining repeated ID numbers when transposing with reshape
I have a dataset in "long" format that looks something like this: ID TEST RESULT 1 A 17 1 A 12 1 B 15 1 C 12 2 B 8 2 B 9 Now what I would like to do is transpose it like so: ID TEST A TEST B TEST C 1 17 15 12 1 12 . . 2
2010 Apr 23
6
transpose? reshape? flipping? challenge with data frame
Greetings all, I am having difficulty transposing, reshaping, flipping (not sure which) a data frame which is read from a DBF file. I have tried using t(), reshape() and other approaches without success. Can anyone please suggest an way (elegant or not) of flipping this data around ? The initial data is like propsum (defined below), and I want it to look like tpropsum once reformed. >
2002 Nov 01
1
Reshape function
Can someone help me with the proper usage of the reshape function? Let's say I have a dataset with columns like this (wide format): Id Sex Group Test Day1 Day 2 Day 3... And I want to transpose this into something like this (thin): Id Sex Group Test Time Where the new column labeled time contains all the time variables (Day 1, Day 2, Day 3...) that were in the wide
2003 Sep 17
2
Transpose Data Frame Question
Hi, I have a data.frame that has 3 columns (ID, Test, Result) and looks like this 1, Test1, 120 1, Test2, 34 2, Test1, 132 2, Test2, 28 etc I would like to turn it around so that it looks like this 1, 120, 34 2, 132, 28 etc I have played around some with t and reshape, but with no success. Any suggestions or hints would be greatly appreciated. Thanks, Bruce
2008 Feb 14
3
Transposing by a group variable
Hi R, Can I transpose a data frame by a particular group variable? For example: d=data.frame(group=c(1,1,2,2,2),val=c(6,4,6,3,5)) And my output should be: data.frame(group=c(1,2),v1=c(6,6),v2=c(4,3),v3=c(NA,5)) Many thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}}
2010 Dec 20
1
transposing panel data
I am currently trying to transpose some large panel data set ie transposing multiple rows in into a single column. instead the transpose functionality transposes all rows into columns. my sample data set looks like below: ACCT_NUM ACCOUNT_NAME TRAN_AMT DATE EMPLOYER 101913 GK 7489 30-Apr-10 PENSION 101913 GK 7489 30-May-10 PENSION 101913
2009 Feb 12
3
Looping multiple output values to dataframe
Dear R users, I have various vector geometry operations to perform on 3-D coordinate data located on multiple (500+) csv files. The code I have written for the calculations works just fine. I have written a 'for' loop to automate the task of extracting the coordinates from the files and perform the analyses. The loop works reasonable well, but if the number of csv files is greater than
2014 Mar 06
1
Create dataframe in C from table and return to R
Hi , I am trying to create a dataframe in C and sebd it back to R. Can anyone point me to the part of the source code where it is doing , let me explain the problem I am having . -------------------------------------------------------------------- My simple implementation is like this SEXP formDF() { SEXP dfm ,df , dfint , dfStr,lsnm; char *ab[3] =
2007 Jun 25
2
transposing data.frames
Hello, This must be simple... Thanks a lot - Christoph # Imagine you have a list, e.g: K <- list(1:10, 2:11, 9:18) K # Transforming to dataframe... KK <- as.data.frame(K) # ... one obtaines the list elements as column. KK # But I need the list elements as rows # How can I achieve this? Is there a simple way to transpose data.frames?
2017 Jun 20
2
by can not find transpose function
I am trying to transpose a dataframe by its first column using the by statement using the t function. When I use the by function, I get a message, Error in FUN(X[[i]], ...) : could not find function "FUN" I don't think I have a syntax error in my by statement because the by statment works using the print function. Data and an executable example follows: phonydata2 <-
2009 Aug 27
5
Transform data for repeated measures
I have a dataset that I'm trying to rearrange for a repeated measures analysis: It looks like: patient basefev1 fev11h fev12h fev13h fev14h fev15h fev16h fev17h fev18h drug 201 2.46 2.68 2.76 2.50 2.30 2.14 2.40 2.33 2.20 a 202 3.50 3.95 3.65 2.93 2.53 3.04 3.37 3.14 2.62 a 203 1.96 2.28 2.34 2.29 2.43 2.06 2.18 2.28 2.29 a
2010 Mar 06
1
transposing data
Hi. I have repeated measures data of the form where each observation is a trial, and trials are grouped by subject, and variables encode whatever level of a factor was present during that trial, and the dependent variable is response time (RT). I want to transpose the data to a form suitable for MANOVA such that there is one observation per subject and RT is recoded across many
2010 Jul 30
4
transpose of complex matrices in R
Hello everybody When one is working with complex matrices, "transpose" very nearly always means *Hermitian* transpose, that is, A[i,j] <- Conj(A[j,i]). One often writes A^* for the Hermitian transpose. I have only once seen a "real-life" case where transposition does not occur simultaneously with complex conjugation. And I'm not 100% sure that that wasn't a
2010 Dec 20
2
package "arules" - 'transpose' of the transactions
Suppose this is my list of transactions: set.seed(200) tran=random.transactions(100,3) inspect(tran) items transactionID 1 {item80} trans1 2 {item8, item20} trans2 3 {item28} trans3 I want to get the 'transpose' of the data, i.e. transactionID items 1 {trans2} item8 2 {trans2} item20 3 {trans3} item28 4 {trans1} item80 I