Skip to content

Vector from Matrix

4 messages · Thiem Alrik, Dennis Murphy, David Winsemius +1 more

#
On Jan 29, 2010, at 11:25 AM, Thiem Alrik wrote:

            
I am guessing that you wanted to type:
data.set <- matrix(rnorm(20000), 100, 200)
If so, then this should be step 1:

sum( pmin(data.set[,1], data.set[,101]))/sum(data.set[,101])
Perhaps (runs without error but unverified):

sapply(1:100, function(x) sum(pmin(data.set[,x], data.set[,100+x]))/ 
sum(data.set[,100+x]))
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
#
Try this also:

pmin(data.set[,1:100], data.set[,101:200])/colSums(data.set[,101:200])
On Fri, Jan 29, 2010 at 2:25 PM, Thiem Alrik <thiem at sipo.gess.ethz.ch> wrote: