[R] algorithm to create unique identifiers

2008-09-04 Thread Ralph S.
Hi all, I am trying to create a unique identifier for each row, combining numbers from three columns. Do you know if there is a general formula to do this (or some manual where I can read about this)? I figure I can use the numeric entries of the columns as "coordinates" and multiply them wi

Re: [R] subsetting matrix according to columns with character index

2008-08-13 Thread Ralph S.
understand > what you want then either of the following should work: > > DFsub<-DF[DF$z == 1 & DF$z == 2,] > > or > > DFsub<-subset(DF, z == 1 & z == 2 ) > > > On Wed, Aug 13, 2008 at 2:00 PM, Ralph S. wrote: > > > Hi, > > > > I

[R] subsetting matrix according to columns with character index

2008-08-13 Thread Ralph S.
Hi, I have a long matrix of the following form which I would like to subset according to the third column: [x y z]: a1 c1 1 a1 c1 2 a2 c1 1 a1 c2 1 a1 c2 2 . . . The first two columns a characters ai and cj. I would like to keep all the rows where there are two entries for z, 1 and 2. Tha

[R] Eaxct position of specific elements in array

2008-08-01 Thread Ralph S.
Hi, I am trying to get the positions in array coordinates (needed later) of certain elements in an array but I am not sure how to get them. My array is Q and the condition is dt>dV, where dt and dV are arrays of exactly the same dimensions as Q. I know that I can extract the elements of Q by

Re: [R] Cannot re-start R after bus error

2008-07-22 Thread Ralph S.
ply. > > > > On Tue, Jul 22, 2008 at 4:22 PM, Ralph S. wrote: > >> Hi, >> >> I ran a program that was exhausting the (unix) server's available >> memory. I got a bus error and then chose to save and quit workspace >> (option 4). >> >&

[R] Cannot re-start R after bus error

2008-07-22 Thread Ralph S.
Hi, I ran a program that was exhausting the (unix) server's available memory. I got a bus error and then chose to save and quit workspace (option 4). That may not have been a smart idea - when I try to use R now, I get the error message: Error in load(name, envir = .GlobalEnv) : ReadItem:

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread Ralph S.
4 2 > 2323 > 317 10 > > > On Sun, Jul 20, 2008 at 7:57 PM, Ralph S. wrote: >> >> The first and second column are actually indices of another matrix (my >> example may make this not sufficiently clear). I want to compare t

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread Ralph S.
n Sun, Jul 20, 2008 at 4:16 PM, Ralph S. wrote: >>> >>> Hi, >>> >>> I am trying to calculate the sum for each occurrence of the level of a >>> factor in a very large matrix. In addition, I want to save that sum >>> together with the information

[R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread Ralph S.
Hi, I am trying to calculate the sum for each occurrence of the level of a factor in a very large matrix. In addition, I want to save that sum together with the information of the level of the factor and the level of a second factor. My matrix looks like this: x<-matrix(c(1,1,1,2,2,3,3,1,1,7,

Re: [R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Ralph S.
(x.row[[.fact]], n[.fact]),] > + }) >> do.call(rbind, result) > [,1] [,2] > [1,]11 > [2,]13 > [3,]11 > [4,]13 > [5,]24 > [6,]24 >> > > > On Sat, Jul 19, 2008 at 7:17 PM, Ralph S. wrote: >> >>

Re: [R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Ralph S.
9:25 +0200 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > CC: r-help@r-project.org > Subject: Re: [R] replicate matrix blocks different numbers of times into new > matrix > > Ralph S. wrote: >> Hi, >> >> I am trying to replicate blocks of a matrix (defined

[R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Ralph S.
Hi, I am trying to replicate blocks of a matrix (defined by factors) into another matrix, but an unequal, consecutive number of times for each factor. I need to find an elegant and fast way to do this, so loops will not work. An example of what I am trying to do is the following: # the data

[R] Cointegration no constant

2008-03-19 Thread Ralph S.
Hi, I am trying to estimate a VECM without constant using the following code: data(finland) sjf <- finland sjf.reg<-ca.jo(sjf, type = c("eigen"), ecdet = c("none"), K = 2,spec=c("transitory"), season = NULL, dumvar = NULL) cajools(sjf.reg) While the cointegration test does not use a constant,