similar to: Concatenating data frame

Displaying 20 results from an estimated 10000 matches similar to: "Concatenating data frame"

2012 Aug 23
3
Concatenating data frames in R versus SAS
I am trying to concatenate 2 datasets that don't have exactly the same column. In SAS I did: data summary; set agency prop; run; No problem in R I get error message summary <-rbind(agency,prop) Error in match.names(clabs, names(xi)) : names do not match previous names But when I use rbin.fill, that overwrites the second file w/ first one. Is there a way to replicate the sas process
2007 Jul 03
2
vertically concatenating data frames
Hi, what is the recommended way to vertically concatenate 2 data frames with the same column names but different number of rows? My problem is something along these lines: df1 <- data.frame(var1=var1,var2=var2,var3=var3) # nrow(df1)=1000 df2 <- data.frame(var1=var4,var2=var5,var3=var6) # nrow(df2)=2000 I tried df <- c(df1,df2), no success. stack does not seem to be appropriate
2011 May 05
1
lapply, if statement and concatenating to a list
Hi R users I was wondering on how to use lapply & co when the applied function has a conditional statement and the output is a 'growing' object. See example below: list1 <- list('A','B','C') list2 <- c() myfun <- function(x,list2) { one_elem <- x cat('one_elem= ', one_elem, '\n') random <- sample(1:2,1) show(random)
1999 Dec 20
2
concatenating dataframes (PR#381)
The following work if y is an ordinary matrix but not a dataframe: tt <- NULL y <- data.frame(1:20,1:20) rbind(tt,y) gives "incompatible types" error (if the dataframe contains only factor variables, it gives warnings but works) if I initialize instead with tt <- list() it gives a "missing value where logical needed" error. Jim
2009 Feb 02
2
concatenating 2 text columns in a data.frame
Hi, I'm trying to concatenate values from two columns in a data frame. For example, I have the following data.frame: C1 C2 C3 C4 C5 A B *F C* Q G H *I J* T K D *R S* E P L *M N* O I'd like to concatenate text from columns C3 and C4, to yield either a list or vector, like so: NewCol FC IJ RS MN Is this feasible in R? Thanks!
2012 Sep 14
4
concatenating two vectors
Dear all, I want to concatenate the elements of two vectors such as a<-c("a1","a2") b<-c("b1","b2") and obtain "a1b1", "a1b2","a2b1","a2b2" I tried the paste and paste0 functions, but they yielded elementwise concatenation such as "a1b1","a2b2" I am wondering that is there an efficient
2009 Jul 31
2
concatenating multiple columns from files
R-users, I want to concatenate columns from different files in a single object. I'm doing bad. My peace of code is as follow: rawdata <- list.files("./data") for (i in rawdata) { mat[ ] <- read.table(paste(i ,sep="")) } At the end of the loop I have just one column. What I'm doing wrong? Thanks, Fred -- View this message in context:
2004 Oct 18
2
concatenating lists elementwise
Hi How do I concatenate two lists element-by-element? Example: list.1 <- list(temperature=c("hot","cold") , size=c("big","medium")) list.2 <- list(temperature=c("lukewarm") , size=c("massive","tiny")) list.wanted <- list(temperature=c("hot","cold","lukewarm") ,
2009 Mar 16
2
Q: [OT] concatenating audio files
Hi, this is a bit off-topic, but maybe you can help me: When extracting the autio track of a concert on video DVD, I noticed that the *.VOB files each contained only about 16 minutes of music, resulting in multiple files. I extracted to flac for further processing, but now I wonder how to make one continuous sound stream of those: Can I simple concatenate the flac files to make on big file
2004 Aug 04
4
Concatenating variables
Hi all: I'm having difficulty with something I believe is very simple, but I'm stuck. I have a large data frame that took days to clean and prepare. All I now need to do is concatenate three variables into a single column. For example, I have tenn$up, tenn$down, and tenn$stable which all have values of 1 or 0. I simply want to put all three columns together to create a pattern (e.g.,
2008 Nov 21
2
Basic question on concatenating factors
Hi all, I hope it's not too trivial for the list - I'm trying to concatenate two factor arrays, and obtain the following: > f1<-factor(c("a","a","b")) > f1 [1] a a b Levels: a b > f2<-factor(c("b","b","a")) > f2 [1] b b a Levels: a b > c(f1,f2) [1] 1 1 2 2 2 1 Instead of getting: [1] a a b b b a Levels: a
2012 Dec 02
1
concatenating expressions and standard text
Hi all, is it possible to concatenate expressions and basic text when for instance labeling axis of a plot? I would like to see something like the concatenation of expression(C[0]) and "for case 1" on my x axis. Obviously a plot(x, y, xlab=paste(expression(C[0])," in case1")) will not work. Thank you in advance, ----- TO GET MORE DETAILS CLICK HERE --
2019 Jan 24
2
Concatenating DWARF location expressions
Hello, Could someone explain to me what the rules are for concatenation of DWARF location expressions? For example in lib/CodeGen/PrologEpilogInserter.cpp there is a call to DIExpression::prepend to concatenate the stack slot address of a variable to an existing expression. Now the problem here is that the former is a 'Memory location description' while the latter could very well be a
2005 Dec 30
1
NewbieQ concatenating name in options_from_collection_for_select
Hi, A real dumb one :~/ How do you concatenate a first_name, last_name as the text method for OFCFS? Damned if I can do it without error. Is it in the original select for the collection? Eric.
2008 Mar 31
1
concatenating two successive time series
Dear Helpers, I am looking for methods and tools to compare and then to concatenate two successive time series. They are both in the same frequency and they describe one phenomena. There is no time gap between them. The problem is that the method of measurements has changed between both time series and they are no statistically the same. I would like to merge them to receive one homogeneous
2010 Jul 19
3
concatenating column names in a loop
Hi all, I am trying to concatenate words together to create new column names, using a loop. Please consider the following toy example: x <- matrix(nrow = 1, ncol = 3) colnames(x) <- c("a", "b", "c") x[1,1] <- "1" x[1,2] <- "2" x[1,3] <- "3" I would like to create a new matrix with column names based on the column names
2006 Feb 25
0
Concatenating of OGG Vorbis files (again)
Hi there, I am trying to find a solution for the problem of contatenating OGG Vorbis files. Yes, I know that this can be done by standard "cat" tool but in this case there are generaly two problems. At first some of the players doesn't seek correctly (e.g. amarok). And the second problem is that if I have many files to concatenate (~50) then it takes quite long time for the player
2019 Jan 25
2
Concatenating DWARF location expressions
> From: aprantl at apple.com <aprantl at apple.com> > Since it sounds like the problem is only with implicit descriptions, would a rule > such as "if the expression has a DW_OP_stack_value, add an extra > DW_OP_deref" work for the PrologueEpilgueInserter or do we need > something more principled? Right, that could very well be sufficient for this particular case so
2009 May 18
9
Concatenating two vectors into one
Dear users, a very simple question: Given two vectors x and y x<-as.character(c("A","B","C","D","E","F")) y<-as.factor(c("1","2","3","4","5","6")) i want to combine them into a single vector z as A1, B2, C3 and so on. z<-x*y is not working, i tried several others
2014 Jan 07
1
BUG report: doveadm HEADER <field> <pattern> when concatenating with another Search key
Hey there, I'm pretty sure I've found a bug with doveadm when concatenating with another search key. While doveadm HEADER <field pattern> works fine when not using additional search keys, it doesn't work properly when concatenating with other serarch keys - it then simply seems to ignore the additional HEADER <field pattern> search key. It's reproduceable, also