similar to: transposing data

Displaying 19 results from an estimated 19 matches similar to: "transposing data"

2011 Feb 14
1
conditional value assignment
Dear R-Help, I am trying to compute a new variable, let's call it "target cannon orientation (tco)" based conditionally on old variables, "TargetColor," "CannonOriB," and "CannonOriR." For every case in the data set, if TargetColor is "B" then I want tco to equal the value for that case of CannonOirB, else CannonOriR. I've tried writing
2011 Apr 07
2
replace an expression with its value, or read macros
I know my subject line seems odd, but I want to replace an expression—such as a variable—with its value. For example, I want to paste() some strings together, assign the result to a variable s, then use the value of s as a variable to hold another value. Something like this: import_subjects <- function (start, iterations) { for (i in 1:iterations) { # iterate from start to end s <-
2011 Apr 10
2
list to data frame
I need to make a data frame out of the data that I currently have in a list. This works, but is ugly: ineffData<-rbind(ineffFilesList[[1]], ineffFilesList[[2]], ineffFilesList[[3]], ineffFilesList[[4]], ineffFilesList[[5]], ineffFilesList[[6]], ineffFilesList[[7]], ineffFilesList[[8]], ineffFilesList[[9]], ineffFilesList[[10]], ineffFilesList[[11]], ineffFilesList[[12]], ineffFilesList[[13]],
2012 Apr 09
2
return one vector that is the sum of a list of vectors
Dear R Help, I am attempting to write a function that takes a list of variable groups and a vector of numbers (e.g., "jtsv" would indicate one group of variables, "jtsv1", "jtsv2", etc, each of which name a variable in a data frame), and returns a list of variable group sums. For example, given list("jtsv", "ptsv") and c(1:10), where jtsv1, etc,
2010 Feb 21
1
tests for measures of influence in regression
influence.measures gives several measures of influence for each observation (Cook's Distance, etc) and actually flags observations that it determines are influential by any of the measures. Looks good! But how does it discriminate between the influential and non- influential observations by each of the measures? Like does it do a Bonferroni-corrected t on the residuals identified by
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?
2006 May 09
1
transposing a big data file
I HAVE A VERY BIG DATA OF 67 COLMS AND 25000 ROWS AND WOULD LIKE TO TRANSPOSE IT THE R HELP WAS NOT ENOUGH INFORMATION BECOUSE I AM NOT A PROGRAMMER AND FIRST TIME R USER. SO CAN YOU GIVE SOME HINTS OF CODING, AA TT GG GG CC AA TT GG GG CC AA TT GG GG CC AA TT GG GG CC AA TT GG GG CC TO AA AA AA AA AA TT TT TT TT TT GG GG GG GG GG GG GG GG GG GG CC CC CC CC CC [[alternative HTML
2010 Oct 29
1
transposing a column table
Dear R-user, I need help on how to transpose this column of clustering vector in R with 8768 entries derived from a PAM clustering output in a vertical  view to an excel file   Clustering vector:    [1] 1 1 2 2 1 2 1 2 1 1 2 2 1 2 2 2 2 1 1 1 1 2 2 1 2 2 1 2 2 2 2 2 2 2 2 1 2   [38] 2 1 1 2 2 2 2 2 1 2 1 2 2 2 2 1 2 1 2 2 1 2 2 2 2 2 2 1 2 1 2 2 2 1 1 2 2   [75] 2 1 2 2 2 2 2 2 2 1 1 2 1 2 2 2 2 2
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
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}}
2008 Apr 15
2
Transposing Data Frame does not return numeric entries
x <- read.table("LittleGarvin.csv", sep=",", header=TRUE) y <- t(x) str(y) chr [1:193, 1:288] "oligocha" "0" " 0" " 0" " 0" "0" ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:193] "X" "upwd1201" "upwd0502" "upwd0702" ... ..$ : NULL x is a data frame with
2009 Apr 23
2
transposing a matrix - row by row?
Hello, I have a matrix that is a product of tapply on a larger data set. Let's assume it looks like this: X<-matrix(c(10,20,30,40,50,60),2,3) dimnames(X)<-list(c("1","2"),c("1","2","3")) (X) 1 2 3 1 10 30 50 2 20 40 60 Is there an efficient way of transforming this matrix into the following matrix: rows columns entries 1
2010 Jun 29
2
transposing a data frame from horizontal to vertical (stacking)
Hello, everyone! I have a very simple task - I have a data frame (see MyData below) and I need to stack the data (see result below). I wrote the syntax below - it's very basic and it does what I need. But I am sure what I am trying to do is a very typical task and there must be a much shorter/more elegant way of doing it. Any advice? Thank you very much!
2009 May 15
2
transposing/rotating XY in a 3D array
Dear list, We have a number of files containing similarly structured data: file1: A B C 1 2 3 4 5 6 file2: A B C 7 8 9 10 11 12 ... etc My part of R receives all these data as an array: 1,2,3... 12 together with info about dimensions (row,col,fileN) . ( Converting the data into 3D cannot simply done by: array(x, c(2,3,2)) because breaks the structure (e.g. 1,3,5 is type mismatch)
2012 Mar 17
2
Reading then transposing from file
Hi, I'm an R beginner and I'm struggling with what should be a rudimentary task. My data is along these lines: ID name1 name2 name3 name4 Class 0 1 0 2 Var1 A B C A Var2 B C C A Var3 C A B A etc. I'm using the following: foo <- data.frame(t(read.table("file", header=FALSE))) but of course now it's not using ID, Class, etc. as column names. As you can imagine,
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
2009 Sep 11
1
transposing a distance matrix in R
Hi Jeannine, I'm just forwarding this Q&A back to the r-help list, you'll get more eyes on it and other people might have better solutions. Answers inline: On Sep 11, 2009, at 12:25 PM, Jeannine Cavender-Bares wrote: > Dear Steve, > > Greetings! You helped me earlier this summer with an R question in > response to a message Brian McCarthy put out on the listserv. I
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 Jan 15
4
transposing a list of vectors
I have a list of vectors, all forced to be the same length: testlist <- list( shape=c(0, 0, 2), cell.fill=c("red","blue","green"), back.fill=rep("white",3), scale.max=rep(100,3) ) > str(testlist) List of 4 $ shape : num [1:3] 0 0 2 $ cell.fill: chr [1:3] "red" "blue" "green" $ back.fill: chr [1:3]