Skip to content

combine two columns

4 messages · TEMPL Matthias, Srinivas Iyyer, Brian Ripley +1 more

#
Hello,

Following should work.

m <- matrix(round(runif(16,0,2)),nrow=2)
colnames(m) <- c("A","A","B","B","C","C","D","D")
m2 <- m #matrix(, nrow=dim(m)[1], ncol=dim(m)[2]/2)
z <- 1
ss <- seq(1,dim(m)[2],2)

for(j in ss){
  for(i in 1:dim(m)[1]){
    m2[i,j] <- substring(m[i,ss[z]] == m[i,ss[z]+1],1,1)
  }
  z <- z + 1
}
m2 <- m2[,ss]
colnames(m2) <- colnames(m)[ss]

When your data set is large, then you should try to code this using
apply.

Best,
Matthias
#
Dear Group, 
 I have a machine which has a 64bit Intel?? Xeon?
Processor 3.00GHz, 2MB L2 Cache 6T302N - [ 221-7984 ]
processor. 
(Dell Precision Workstation 670n Intel?? Xeon?
Processor)

The OS is RedHat Enterprise Linux version 4 (for
64bit). 

I went to /bin/linux/redhat/el4/i386 on CRAN FTP site.
 I have no clue if any of these RPMs are suitable for
this machines configuration. 

Could any one point me to an appropriate RPM that I
can download and install it on this machine. 

Thank you. 

Sr
#
You don't seem to know your OS spec, so how can we guess?
You chip can run various different OSes.  RH claim to have
RHEL4 for AMD64/EM64T, but not `for 64bit'.

Use uname -a.  If it mentions ix86 (for x=3,4,5,6 or perhaps 7) use that 
RPM.  I expect it will mention x86_64.  In that case you may need to 
install from the sources.  One way to do so is to install the SRPM, 
rpmbuild that and then install it.  But building from the source tarball 
is also a cinch, and will avoid RH's broken blas library (if you have that 
installed).  The other advantage is that you can install the current 
R-patched rather than R-2.2.0 and benefit from all the patches.

Of course, it is possible that RedHat has an RPM (they do for FC3 and
FC4), so have you checked their repositories?
On Tue, 29 Nov 2005, Srinivas Iyyer wrote:

            

  
    
#
Many packages in Fedora Extras, including R, have been recompiled for
CentOS (a RHEL clone). You can find them here:

http://centos.karan.org/

They should be compatible with RHEL, but of course your mileage may
vary.

Martyn
On Tue, 2005-11-29 at 20:43 +0000, Prof Brian Ripley wrote:
-----------------------------------------------------------------------
This message and its attachments are strictly confidential. ...{{dropped}}