[R] logical or for two vectors or matrices

2007-05-04 Thread Federico Abascal
Hello, it might be a very simple question but I cannot find the solution (I tried a || b, any(a,b)... but none works). My problem is: I have two vectors, a - c(TRUE,FALSE,FALSE) b - c(TRUE,FALSE,TRUE) and I would like to obtain a vector that indicates if it is TRUE in any of the two vectors.

Re: [R] logical or for two vectors or matrices

2007-05-04 Thread Federico Abascal
I think I found the solution (just after sending the email). The following apparentely works: a == TRUE | b ==TRUE Regards, Federico Federico Abascal [EMAIL PROTECTED] escribió: Hello, it might be a very simple question but I cannot find the solution (I tried a || b, any(a,b)... but none

[R] comparing two matrices, row by row

2007-04-26 Thread Federico Abascal
Estimated people, I have two matrices: ar1 - array(data=c(1:16),dim=c(4,4)) ar2 - array(data=c(1,2,3,3,5:16),dim=c(4,4)) They only differ in the fourth row. I would like to compare them in order to know which columns are equal. The following works, but I would like to have a better solution,

[R] comparing two matrices, row by row

2007-04-26 Thread Federico Abascal
Estimated people, I have two matrices: ar1 - array(data=c(1:16),dim=c(4,4)) ar2 - array(data=c(1,2,3,3,5:16),dim=c(4,4)) They only differ in the fourth row. I would like to compare them in order to know which columns are equal. The following works, but I would like to have a better

[R] font size in plots

2007-02-14 Thread Federico Abascal
Dear members of the list, it is likely a stupid question but I cannot find the information neither in R manuals nor in google. I am generating a plot (from hclust results) but I cannot see properly the labels because the default font size is too large. How can I change it? Thanks! Federico

[R] matrix of matrices

2007-02-01 Thread Federico Abascal
Dear all, it is likely a stupid question but I cannot solve it. I want to have a matrix of 100 elements. Each element must be a vector of 500 elements. If I do: imp-array(dim=100) imp[1]-vector(length=500) it does not work. Warning message: number of items to replace is not a multiple

Re: [R] matrix of matrices

2007-02-01 Thread Federico Abascal
For the case someone is interested in it, here it is the solution somebody suggested me: to use a list. imp - vector(list, 100) imp[[1]] - im[1:500,] names(imp[[1]]) = the list of labels of imp[1:500,] Thanks! Federico Federico Abascal wrote: Dear all, it is likely a stupid question but I

[R] how to join two arrays using their column names intersection

2007-01-30 Thread Federico Abascal
Dear all, I have a problem that may be someone of you can help. I am a newbie and do not find how to do it in manuals. I have two arrays, for example: ar1 - array(data=c(1:16),dim=c(4,4)) ar2 - array(data=c(1:16),dim=c(4,4)) colnames(ar1)-c(A,B,D,E) colnames(ar2)-c(C,A,E,B) ar1 A B D E