similar to: cbind and cbind.data.frame

Displaying 20 results from an estimated 30000 matches similar to: "cbind and cbind.data.frame"

2013 Sep 05
2
binary symmetric matrix combination
Hi, May be this helps: m1<- as.matrix(read.table(text=" y1 g24 y1 0 1 g24 1 0 ",sep="",header=TRUE)) m2<-as.matrix(read.table(text="y1 c1 c2 l17 ?y1 0 1 1 1 ?c1 1 0 1 1 ?c2 1 1 0 1 ?l17 1 1 1 0",sep="",header=TRUE)) m3<- as.matrix(read.table(text="y1 h4??? s2???? s30 ?y1 0 1 1 1 ?h4 1 0 1 1 ?s2 1 1 0 1 ?s30 1 1 1
2012 May 25
3
Multiple cbind according to filename
Hi all, I'm just a beginner with R but I have not been able to search for any relevant answer to my problem. I apologize if it has in fact been asked before. Recently I've realized that I need to combine hundreds of pairs of data frames. The filenames of the frames I need to combine have unique strings. This is my best guess as to the approach to take: filenames<-list.files()
2010 Nov 08
1
unknown dimensions for loglm
Dear R-help community, I am working with multidimensional contingency tables and I am having trouble getting loglm to run on all dimensions without typing out each dimension. I have generated random data and provided output for the results I want below: d1.c1 <- rnorm(20, .10, .02) d1.c2 <- rnorm(20, .10, .02) d2.c1 <- rnorm(20, .09, .02) d2.c2 <- rnorm(20, .09, .02) d3.c1 <-
2010 Jun 24
1
?to calculate sth for groups defined between points in one variable (string), / value separating/ spliting variable into groups by i.e. between start, NA, NA, stop1, start2, NA, stop2
Dear useRs, Thanks for any advices # I do not know where are the examples how to mark groups # based on signal occurence in the additional variable: cf. variable c2, # How to calculate different calculations for groups defined by (split by occurence of c2 characteristic data) #First example of simple data #mexample 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
2012 Aug 28
1
Optim Problem
Hello, I want to estimate the exponential parameter by using?optim?with the following input, where t contains 40% of the data and q contains 60% of the data within an interval. In implementing the code command for optim i want it to contain both the t and q data so i can obtain the correct estimate. Is there any suggestion as to how this can be done. I have tried h<-c(t,q) but it is not working
2016 Apr 17
2
Trying to understand cut
I am trying to understand cut so I can divide a list of numbers into 10 group: 0-9.0 10-10.9 20-20.9 30-30.9, 40-40.9, 50-50.9 60-60.9 70-70.9 80-80.9 90-90.9 As I try to do this, I have been playing with the cut function. Surprising the following for applications of cut give me the exact same groups. This surprises me given that I have varied parameters include.lowest and right. Can someone
2011 Sep 25
2
help about R basic
This is my first time to ask for help in the R mailing list, so sorry for my misbehavior. The question is actually an example of the apply function embedded in R. Code is here: > x <- cbind(x1 = 3, x2 = c(4:1, 2:5)) > dimnames(x)[[1]] <- letters[1:8] > x x1 x2 a 3 4 b 3 3 c 3 2 d 3 1 e 3 2 f 3 3 g 3 4 h 3 5 > cave <- function(x, c1, c2) c(mean(x[c1]),
2016 Apr 17
0
Trying to understand cut
Have you read FAQ 7.31 recently, John? Your whole premise is flawed. You should be thinking of ranges [0,10), [10,20), and so on because numbers ending in 0.9 are never going to be exact. -- Sent from my phone. Please excuse my brevity. On April 16, 2016 7:38:50 PM PDT, John Sorkin <jsorkin at grecc.umaryland.edu> wrote: >I am trying to understand cut so I can divide a list of numbers
2009 Jul 01
1
How should I denormalise a data frame list of lists column?
Hi, I have a data frame where one column is a list of lists. I would like to subset the data frame based on membership of the lists in that column and be able to 'denormalise' the data frame so that a row is duplicated for each of its list elements. Example code follows: # The data is read in in this form with the c2 list values in single strings which I then split to give lists: > f1
2007 Nov 22
1
Summary: Process multiple columns of data.frame
Thank you Jim Holtman and Mark Leeds for your help. Original question: >How do I do the following more concisely? > Bout[is.na(Bout$bd.n), 'bd.n'] <- 0 > Bout[is.na(Bout$ht.n), 'ht.n'] <- 0 > Bout[is.na(Bout$dbh.n), 'dbh.n'] <- 0 >. . . Solution: for (i in c('bd.n', 'ht.n', 'dbh.n')) Bout[is.na(Bout[[i]]), i] <- 0 Toy
2008 Dec 01
1
request: how to assign alphabets to integer values
Dear R community I am trying to assign alphabets to integer values 1, 2, 3 etc. in y given below. Can any body suggest some simple way to do the same job? ds=iris; dl=nrow(ds) c1=ds[,1]; c2=ds[,2]; c3=ds[,3]; c4=ds[,4]; c5=ds[,5]; iris=cbind(c1,c2,c3,c4,c5) y=iris[,5] y1=which(y==1); y[y1] <- c("a"); y2=which(y==2); y[y2] <- c("b"); y3=which(y==3); y[y3] <-
2010 Jan 08
3
Print data frame as list including row/column name
Hi all, I have the following problem: I have a data frame (actually it is a prop.table) which I want to print as a list, e.g.: C1 C2 C3 R1 0.0 0.0 1.0 R2 1.0 0.0 0.0 R3 0.0 0.0 0.0 R4 0.0 1.0 0.0 should be printed like C1;R1;0.0 C2;R1;0.0 C3;R1;1.0 C1;R2;1.0 C2;R2;0.0 ..... Is there any existing solution out there or could somebody please give me a hint on how to
2016 Feb 15
1
[PATCH 09/23] nv50-: separate vertex formats from surface format descriptions
Why not fix the new names instead to be like the old names? Seems like that would be way simpler... On Feb 15, 2016 12:38 AM, "Ben Skeggs" <skeggsb at gmail.com> wrote: > From: Ben Skeggs <bskeggs at redhat.com> > > We've previously had identical naming between vertex and texture > formats, so it mostly made sense to define these together. > > However,
2015 Dec 19
2
[PATCH] nvc0: add hardware ETC2 and ASTC support where possible
These are supported on GK20A and GM107. Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- Was a bit torn on where to place the enums... we're about to gut all the xml definitions so this seemed appropriate for now. Tested on GK20A only. src/gallium/drivers/nouveau/nv50/nv50_formats.c | 64 +++++++++++++++++++++++++ src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 10 ++++
2016 Apr 17
3
Trying to understand cut
Jeff, Perhaps I was sloppy with my notation: I want groups >=0 <10 >=10 <20 >=20<30 ...... >=90 <100 In any event, my question remains, why did the four different versions of cut give me the same results? I hope someone can explain to me the function of include.lowest and right in the call to cut. As demonstrated in my example below, the parameters do not seem to alter
2015 Apr 15
2
[LLVMdev] Instruction combiner multiplication canonicalization
Hi, I observed below behavior with Instruction combiner (visitMul Canonicalization) It tries to convert "(X+C1)*C2" to "X*C2+C1*C2" While transforming if operation is guaranteed to not overflow it does not reflect same property to transformed instructions. Consider following scenarios: 1) If input is ((X+C1)*C2)<nsw> Then post canonicalization output should be
2013 Mar 14
2
Modifying a data frame based on a vector that contains column numbers
Hello! # I have a data frame: mydf<-data.frame(c1=rep(NA,5),c2=rep(NA,5),c3=rep(NA,5)) # I have an index whose length is always the same as nrow(mydf): myindex<-c(1,2,3,2,1) # I need c1 to have 1s in rows 1 and 5 (based on the information in myindex) # I need c2 to have 1s in rows 2 and 4 (also based on myindex) # I need c3 to have 1 in row 3 # In other words, I am trying to achieve this
2009 May 07
2
Matching multiple columns in a data frame
Hello, I am trying to extract a subset of a dataframe A (2 columns) by extracting all entries in A (several repeated entries) that match dataframe B in both columns. For example, part of A and B are shown below. The following does not seem to work correctly. This only seems to select on the first component and all instances of the second. ind <- A$C1 %in% B[,1] & A$C2 %in% B[,2]
2010 Feb 10
1
looping problem
Hi R-users,   I have this code here: library(numDeriv)   fprime <- function(z) { alp  <- 2.0165;   rho  <- 0.868;   # simplified expressions   a      <- alp-0.5   c1     <- sqrt(pi)/(gamma(alp)*(1-rho)^alp)   c2     <- sqrt(rho)/(1-rho)   t1     <- exp(-z/(1-rho))   t2     <- (z/(2*c2))^a   bes1   <- besselI(z*c2,a)   t1bes1 <- t1*bes1   c1*t1bes1*t2 }   ## Newton
2007 Aug 27
1
use apply function with which
Dear R-users, For a data frame (say in this example X) I want to look up the corresponding value in a 'look-up data frame' (in this example Y). The for-loop works but is very time-consuming because 'X' in reality is very big. Therefore I would like to have a solution with apply. However, I do not succeed. Any suggestions? Thanks in advance, Hanneke