[R] cbind

2007-06-29 Thread livia
Hi, I have a series of return data, a and b are factors. I would like to build a matrix which contains each vector of returns. I am thinking about something as following, but I guess there should be a sensible way of doing this. returns - split(return, list(regimef, assetf)) cbind(returns[[1]],

Re: [R] cbind

2007-06-29 Thread Tobias Verbeke
livia wrote: Hi, I have a series of return data, a and b are factors. I would like to build a matrix which contains each vector of returns. I am thinking about something as following, but I guess there should be a sensible way of doing this. returns - split(return, list(regimef, assetf))

Re: [R] cbind

2007-06-29 Thread jim holtman
why don't you use a 'list' as the return value. The 'cbind' is going to assume that each of the 'return[[..]]' have the same length or you are going to get error messages: cbind(1:3,4:10) [,1] [,2] [1,]14 [2,]25 [3,]36 [4,]17 [5,]28 [6,]39

[R] cbind/rbind and NULL

2005-10-18 Thread McGehee, Robert
I'm trying to understand why I can rbind but not cbind dataframes to NULLs. For 'cbind' ('rbind'), vectors of zero length (including 'NULL') are ignored unless the result would have zero rows (columns), for S compatibility. (Zero-extent matrices do not occur in S3 and are

[R] cbind and rbind

2005-08-22 Thread Tony Evans
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]]

Re: [R] cbind and rbind

2005-08-22 Thread Andy Bunn
by some R-guru, but that's part of the fun of it all! I hope that helps, Andy -Original Message- From: Tony Evans [mailto:[EMAIL PROTECTED] Sent: Monday, August 22, 2005 8:03 PM To: Andy Bunn Subject: Re: [R] cbind and rbind Sorry, I did read the guide but am very new to this. I

[R] R: cbind

2005-08-08 Thread Clark Allan
hi all are we able to combine column vectors of different lengths such that the result appears in matrix form? e.g. a=1 b=1:3 d=1:4 then z=CBIND(a,b,d) 1 1 1 2 2 3 3 4 i stil want the following! z[,1]=1 z[,2]=1:3 z[,3]=1:5 i made up the name of this function. we could use cbind

Re: [R] R: cbind

2005-08-08 Thread Uwe Ligges
Clark Allan wrote: hi all are we able to combine column vectors of different lengths such that the result appears in matrix form? e.g. a=1 b=1:3 d=1:4 then z=CBIND(a,b,d) 1 1 1 2 2 3 3 4 i stil want the following! z[,1]=1 z[,2]=1:3 z[,3]=1:5 i made up

Re: [R] R: cbind

2005-08-08 Thread Sundar Dorai-Raj
Clark Allan wrote: hi all are we able to combine column vectors of different lengths such that the result appears in matrix form? e.g. a=1 b=1:3 d=1:4 then z=CBIND(a,b,d) 1 1 1 2 2 3 3 4 i stil want the following! z[,1]=1 z[,2]=1:3 z[,3]=1:5 i made

Re: [R] R: cbind

2005-08-08 Thread Gabor Grothendieck
On 8/8/05, Clark Allan [EMAIL PROTECTED] wrote: hi all are we able to combine column vectors of different lengths such that the result appears in matrix form? e.g. a=1 b=1:3 d=1:4 then z=CBIND(a,b,d) 1 1 1 2 2 3 3 4 i stil want the following! z[,1]=1

Re: [R] R: cbind

2005-08-08 Thread Gabor Grothendieck
On 8/8/05, Gabor Grothendieck [EMAIL PROTECTED] wrote: On 8/8/05, Clark Allan [EMAIL PROTECTED] wrote: hi all are we able to combine column vectors of different lengths such that the result appears in matrix form? e.g. a=1 b=1:3 d=1:4 then z=CBIND(a,b,d) 1 1 1

[R] cbind a list of matrices

2005-07-16 Thread Mauro Gasparini
Dear users, I have a list of several matrices with the same number of columns, how do I rbind them all with a vectorized command? A related simpler question is, how do I vectorize the instruction that rbinds together several copies of the same matrix? Thanks. -- Mauro Gasparini

Re: [R] cbind a list of matrices

2005-07-16 Thread Ted Harding
On 16-Jul-05 Mauro Gasparini wrote: Dear users, I have a list of several matrices with the same number of columns, how do I rbind them all with a vectorized command? A related simpler question is, how do I vectorize the instruction that rbinds together several copies of the same matrix?

Re: [R] cbind a list of matrices

2005-07-16 Thread Peter Dalgaard
(Ted Harding) [EMAIL PROTECTED] writes: On 16-Jul-05 Mauro Gasparini wrote: Dear users, I have a list of several matrices with the same number of columns, how do I rbind them all with a vectorized command? A related simpler question is, how do I vectorize the instruction that

Re: [R] cbind a list of matrices

2005-07-16 Thread S.O. Nyangoma
Didn't you simply try: A-matrix(c(1.1,1.2,1.3,1.4,1.5,1.6),ncol=3) B-matrix(c(2.1,2.2,2.3,2.4,2.5,2.6),ncol=3) C-matrix(c(3.1,3.2,3.3,3.4,3.5,3.6),ncol=3) A [,1] [,2] [,3] [1,] 1.1 1.3 1.5 [2,] 1.2 1.4 1.6 B [,1] [,2] [,3] [1,] 2.1 2.3 2.5 [2,] 2.2 2.4 2.6

Re: [R] cbind() and factors.

2004-12-11 Thread Frank E Harrell Jr
Gabor Grothendieck wrote: michael watson (IAH-C michael.watson at bbsrc.ac.uk writes: : : Hi : : I'm seeing some odd behaviour with cbind(). My code is: : : cat - read.table(cogs_category.txt, sep=\t, header=TRUE, : quote=NULL, colClasses=character) : colnames(cat) : [1] Code

Re: [R] cbind() and factors.

2004-12-10 Thread Stephane DRAY
cat is a data.frame, so cbind is use for a data.frame and ?data.frame tell us that: Character variables passed to 'data.frame' are converted to factor columns unless protected by 'I'. PS : it is not good ides to call your data.frame cat as there is a cat function. At 09:19 10/12/2004,

Re: [R] cbind() and factors.

2004-12-10 Thread Rolf Turner
This is of the nature of an FAQ. Data frames coerce character vectors into factors. If you want a character vector to stay that way (and not become a factor) wrap in up in ``I()'': cat - cbind(cat,Color=I(rainbow(nrow(cat (There's no need to quote the name ``Color'' in the

Re: [R] cbind() and factors.

2004-12-10 Thread Gabor Grothendieck
michael watson (IAH-C michael.watson at bbsrc.ac.uk writes: : : Hi : : I'm seeing some odd behaviour with cbind(). My code is: : : cat - read.table(cogs_category.txt, sep=\t, header=TRUE, : quote=NULL, colClasses=character) : colnames(cat) : [1] CodeDescription :

Re: [R] cbind() and factors.

2004-12-10 Thread Dieter Menne
Probably you called the build-in rainwbow-function, which returns a string. str(rainbow(10)) chr FF Dieter Menne __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

[R] cbind in a loop

2004-09-08 Thread Jan Wantia
Dear all, I have a problem with adding columns to a data structure, using 'cbind': I create an array, to which I want to cbind one new colum for every iteration of a loop. Without the loop, the code works and looks like this: Min- array(0,c(129,0)) Min [1,] [2,] [3,] [4,] etc.. file -

Re: [R] cbind in a loop

2004-09-08 Thread Sundar Dorai-Raj
Jan Wantia wrote: Dear all, I have a problem with adding columns to a data structure, using 'cbind': I create an array, to which I want to cbind one new colum for every iteration of a loop. Without the loop, the code works and looks like this: Min- array(0,c(129,0)) Min [1,] [2,] [3,]

Re: [R] cbind question

2004-03-27 Thread Prof Brian Ripley
cbind on vectors/matrices which are not atomic is unsupported: we had a bug report on that within the last 24 hours (but it seems to be intentional). You can just concatenate the lists and add a suitable dimension: res - c(ll, sym) dim(res) - c(508,2) if I understand your intentions. I think.

RE: [R] cbind question

2004-03-27 Thread Han, Hillary
= try.txt) Error in cbind(...) : cannot create a matrix from these types -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Sat 3/27/2004 3:30 PM To: Han, Hillary Cc: [EMAIL PROTECTED] Subject:Re: [R] cbind question cbind on vectors/matrices which

RE: [R] cbind question

2004-03-27 Thread Prof Brian Ripley
: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Sat 3/27/2004 3:30 PM To: Han, Hillary Cc: [EMAIL PROTECTED] Subject: Re: [R] cbind question cbind on vectors/matrices which are not atomic is unsupported: we had a bug report on that within the last 24 hours (but it seems

Re: [R] cbind question

2004-03-27 Thread Gabor Grothendieck
: Sat 3/27/2004 3:30 PM : To: Han, Hillary : Cc: r-help at stat.math.ethz.ch : Subject: Re: [R] cbind question : cbind on vectors/matrices which are not atomic is unsupported: we had a : bug report on that within the last 24 hours (but it seems to be : intentional). : : You can just

[R] Cbind warning message

2003-10-16 Thread Paul Lemmens
Hello! I'm not grasping why cbind (in the code below) warns that Warning message: number of rows of result is not a multiple of vector length (arg 2) in: cbind(z, p) when I do sections - function(length, parts) { p - 1:parts q - length %/% parts z - array(p,

Re: [R] Cbind warning message

2003-10-16 Thread Peter Dalgaard BSA
Paul Lemmens [EMAIL PROTECTED] writes: Hello! I'm not grasping why cbind (in the code below) warns that Warning message: number of rows of result is not a multiple of vector length (arg 2) in: cbind(z, p) when I do sections - function(length, parts) { p - 1:parts

Re: [R] cbind order

2003-05-30 Thread Peter Dalgaard BSA
orkun [EMAIL PROTECTED] writes: Hello I need to use this command: cbind(ftable(xtabs(cnt~geo+slp+con+hey,data=dt3)) hey is in count of success /failure value but cbind gives failure/success counts. I want to change the order of this cbind as success /failure counts. for instance: I