similar to: rbind/cbind

Displaying 20 results from an estimated 20000 matches similar to: "rbind/cbind"

2011 Jul 31
3
Display/show the evaluation result of R commands automatically
Hello R-help, I wonder if it is possible to configure R, so that it will display/show the evaluation result of the R commands automatically (similar to the behavior of Matlab) i.e. If I type x <- 8 it will print 8 in the command prompt, instead of having type x explicitly to show the result and perhaps put an ";" at the end to suppress the output. i.e. x <- 8; Thank you
2011 Aug 10
2
join columns
Dear R-help, I wonder if you could give me some suggestions in how to do a union join of two data frames as follow: -> union join the common column, and insert a 0 if one is missing. I made a function to perform the following, and I know it may not that quite welly written, but it works. Any suggestions are welcome, many thanks. Anthony > q1 =
2008 Jun 05
7
Improving data processing efficiency
Hi everyone! I have a question about data processing efficiency. My data are as follows: I have a data set on quarterly institutional ownership of equities; some of them have had recent IPOs, some have not (I have a binary flag set). The total dataset size is 700k+ rows. My goal is this: For every quarter since issue for each IPO, I need to find a "matched" firm in the same
2011 Aug 10
1
column names issue with read.csv
Dear List, I wonder why when using read.csv(), if the column name contains a numeric i.e. a stock symbols-"0001.HK", it will automatically insert an "X" character to the column names - "X0001.HK". Now I have to manually do a loop and use substring() to remove the "X" character. Any advice? Thanks Anthony
2008 Mar 13
2
How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ?
Hi, How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ? > cbind(1:2, 1:10) [,1] [,2] [1,] 1 1 [2,] 2 2 [3,] 1 3 [4,] 2 4 [5,] 1 5 [6,] 2 6 [7,] 1 7 [8,] 2 8 [9,] 1 9 [10,] 2 10 [[alternative HTML version deleted]]
2007 Apr 19
2
rbind() of factors in data.frame
Dear all, I would like to inquire, if it is a desired feature that the combination with rbind() of two data frames with factors columns does not sort the factors levels of the combined data frame. > str(rbind(data.frame(a = factor(c(4, 3))), data.frame(a = factor(c(2, 1))))) 'data.frame': 4 obs. of 1 variable: $ a: Factor w/ 4 levels
2008 Jun 06
6
Subsetting to unique values
I want to take the first row of each unique ID value from a data frame. For instance > ddTable <- data.frame(Id=c(1,1,2,2),name=c("Paul","Joe","Bob","Larry")) I want a dataset that is Id Name 1 Paul 2 Bob > unique(ddTable) Will give me all 4 rows, and > unique(ddTable$Id) Will give me c(1,2), but not accompanied by the name column.
2006 Sep 27
1
S3 methods for cbind/rbind
I created a type of object similar to a data frame. In some circumstances, It needs special methods for "[" and "[<-" and rbind() (but not cbind()). Then I found this in the cbind()/rbind() man page: The method dispatching is _not_ done via 'UseMethod()', but by C-internal dispatching. Therefore, there is no need for, e.g., 'rbind.default'.
2005 Aug 22
1
cbind and rbind
Hi, I have been trying for a while to use cbind and rbind to add a row and column to the same table but seem to be able only to add one OR the other??? Any help would be most welcome, Tony Evans Australia [[alternative HTML version deleted]]
2003 Jul 29
2
cbind/rbind inconsistency with NULL parameter (PR#3585)
R-Version: 1.7.1 (2003-06-16) OS: Debian/GNU Linux cbind and rbind handle NULL parameters inconsistently. Consider: > cbind() NULL > cbind(NULL) NULL And: > cbind(diag(x = 1, 1, 1)) [,1] [1,] 1 > cbind(NULL, diag(x = 1, 1, 1)) [,1] [1,] 1 These seem to indicate that NULL parameters will be ignored in any call to cbind and rbind. However: >
2011 Feb 06
1
Applying 'cbind/rbind' among different list object
Hi, I am wondering whether we can apply 'cbind/rbind' on many **equivalent** list objects. For example please consider following: > list1 <- list2 <- vector("list", length=2); names(list1) <- names(list2) <- c("a", "b") > list1[[1]] <- matrix(1:25, 5) > list1[[2]] <- matrix(2:26, 5) > list2[[1]] <- 10:14 > list2[[2]] <-
2013 Jan 22
1
c(), rbind and cbind functions - why type of resulting object is double
Hello Everyone, I am using R 2.15.0 and I came across this behaviour and I was wondering why I don't get an integer vector or and integer matrix with the following code: > z <- c(1, 2:0, 3, 4:8) > typeof(z) [1] "double" > z <- rbind(1, 2:0, 3, 4:8) Warning message: In rbind(1, 2:0, 3, 4:8) : number of columns of result is not a multiple of vector length (arg
2009 Oct 02
2
how to fill out the empty spots when using rbind or cbind?
I have uneven vectors I want to use cbind or rbind to combine them into a matrix. Is there a way to make it so that R would not return error msg saying they're uneven? Thanks. Edward Chen Email: tkedch@msn.com Cell Phone: 510-371-4717 [[alternative HTML version deleted]]
2005 Oct 21
1
Generalised rbind/cbind
Dear list, Is there a generalised form of rbind/cbind for combining matrices/arrays into higher-D structures? ie. if I have: a <- matrix(2,2,2) b <- matrix(3,2,2) how can I get array(rep(c(3,2), each=4), c(2,2,2)) ? It seems like this would be the job of a generalised abind function: abind(a,b, along=1) == rbind(a,b) abind(a,b, along=2) == cbind(a,b) abind(a,b, along=3)
2007 Jun 21
1
what is "better" when combining data frames? merge vs. rbind & cbind
I often need to "combine" data frames, sometimes "vertically" and other times "horizontally". When it "better" to use merge? When is it better to use rbind or cbind? Are there clear pros and cons of each approach? --------------------------------- [[alternative HTML version deleted]]
2004 Mar 26
4
cbind/rbind fail on matrixes containing lists (PR#6702)
Today's R 1.9.0 beta: > m1 [,1] [,2] [,3] [,4] [1,] NA NA NA NA [2,] NA NA NA NA [3,] NA NA NA NA [4,] NA NA NA NA > class(m1[1,1]) [1] "list" > cbind(m1,m1) Error in cbind(...) : cannot create a matrix from these types > rbind(m1,m1) Error in rbind(...) : cannot create a matrix from these types > version _
2011 Jul 04
1
[R-SIG-Finance] FinCenter in timeSeries with "merge", "cbind" and "rbind"
Hi R users: When I try to merge or bind (cbind or rbind) two series, both with a "FinCenter" different that GMT, the result is "GMT" not the original financial center? What am I doing wrong? ###################################################### require(timeSeries) getRmetricsOptions("myFinCenter") setRmetricsOptions(myFinCenter = "America/Bogota")
2006 Jan 27
1
rbind/cbind unimplemented for raw (RAWSXP) types. (PR#8529)
Full_Name: Hin-Tak Leung Version: R 2.2.1 OS: x86_64-redhat-linux-gnu Submission from: (NULL) (131.111.186.92) rbind/cbind is unimplemented for raw (RAWSXP) types. I have a working patch implementing the functionality, to follow. --please do not edit the information below-- Version: platform = x86_64-redhat-linux-gnu arch = x86_64 os = linux-gnu system = x86_64, linux-gnu status = major
2007 Mar 20
1
cbind() & rbind() for S4 objects -- 'Matrix' package changes
As some of you may have seen / heard in the past, it is not possible to make cbind() and rbind() into proper S4 generic functions, since their first formal argument is '...'. [ BTW: S3-methods for these of course only dispatch on the first argument which is also not really satisfactory in the context of many possible matrix classes.] For this reason, after quite some discussion on
2008 Dec 22
2
... (dotMethods) and cbind/rbind: how to give the signature?
Dear List, I'm struggling with the signature writing cbind/rbind functions for a S4 class. First of all, I'm very happy that it is now possible to dispatch on ... I follow the example for "paste" in ?dotMethods, which works as far as this: ### start example setClass ("cbtest", representation = representation (data = "data.frame"),