similar to: transposing data.frames

Displaying 20 results from an estimated 11000 matches similar to: "transposing data.frames"

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
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
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
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)
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
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
2007 Sep 04
4
integers
Hi list, The function is.integer tests if an object is of type integer: see e.g.: is.integer(12) # FALSE is.real(12) # TRUE mode(12) # "numeric" But how can I test if a number is actually an integer? R seek is difficult to search in this case because it mainly yields entries about the integer()-function family. Thanks for any hint! Christoph Heibl
2006 Sep 20
2
Unexpected behavior of apply() over a 3d array
Dear listeRs, I'm finding that apply() behaves strangely when used on a 3-d array. For example: > at <- array(1:27,dim=c(3,3,3)) > at , , 1 [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 , , 2 [,1] [,2] [,3] [1,] 10 13 16 [2,] 11 14 17 [3,] 12 15 18 , , 3 [,1] [,2] [,3] [1,] 19 22 25 [2,] 20 23 26
2006 Nov 29
2
need help with barplot
Hello, I do this a=c(10.2,0.4,0.2,5.2,8.6,1.6,0.0,1.0,6.3,1.4,0.4,0.2) b=matrix(a,nrow=4) rownames(b)=c("20/04/2002","21/04/2002","22/04/2002","23/04/2002") colnames(b)=c("p1","p2","p3") barplot(b,beside=T,col=(c("red","orange","yellow"))) then I have
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
2012 Feb 28
7
indexing??
Hello All, My algorithm as follows; y <- c(1,1,1,0,0,1,0,1,0,0) x <- c(1,0,0,1,1,0,0,1,1,0) n <- length(x) t <- matrix(cbind(y,x), ncol=2) z = x+y for(j in 1:length(x)) { out <- vector("list", ) for(i in 1:10) { t.s <- t[sample(n,n,replace=T),] y.s <- t.s[,1] x.s <- t.s[,2] z.s <- y.s+x.s out[[i]] <- list(ff <- (z.s), finding=any (y.s==y[j])) kk
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
2008 May 08
2
LaTeX in system()
Dear list, I want to run latex from an R script: system("latex mysource.tex") or: texi2dvi("mysource.tex", pdf = TRUE, clean = FALSE, quiet = TRUE, texi2dvi = latex) but latex does not seem to be on the search path: /bin/sh: line 1: latex: command not found. Although 'printenv PATH' tells me that the usr/texbin is looked for executables:
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 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]
2010 Jan 29
2
question about transpose
Hi all, if I transpose a matrix with t(data), the newly created colums do not appear to have the first row as header. How can I do to have all the newly created columns have their first row as a header? Thanks Gabriele Zoppoli, MD Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy Guest Researcher, LMP, NCI, NIH, Bethesda MD Work: 301-451-8575
2011 Oct 18
1
How to read data sequentially into R (line by line)?
I have a data set like this in one .txt file (cols separated by !): APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! it contains over 14 000 000 records. Now
2009 Oct 19
3
loop and plot
Dear all, I am stuck at applying loop function for creating separated plots. I have coding like below: dataset.table <- table(data.frame(var1=c(1,2,3,1,2,3,1),colour=c("a","b","c","c","a","b","b") )) kk = function(f) { ls=as.character(f) pie(dataset.table[ls,],main=ls)
2001 Feb 08
2
dnbinom(,size<1,)=0 (PR#842)
This came up on r-help but indicates a bug. dnbinom(x,n,p) calls dbinom_raw(n-1,...) which returns 0 for n<1. -thomas ---------- Forwarded message ---------- Date: Thu, 08 Feb 2001 17:10:23 +0000 From: Yudi Pawitan <yudi@stat.ucc.ie> To: Mark Myatt <mark@myatt.demon.co.uk> Cc: R-Help <r-help@stat.math.ethz.ch> Subject: Re: [R] Goodness of fit to Poisson / NegBinomial