ig meddelelse
>> Fra: carol white
>> Dato:14/05/2014 16.53 (GMT+01:00)
>> Til: r-h...@stat.math.ethz.ch
>> Emne: [R] matrix column division by vector
>>
>> Hi,
>> What is the elegant script to divide the columns of a matrix by the
>> respective
Br. Frede
>
>
> Sendt fra Samsung mobil
> Oprindelig meddelelse
> Fra: carol white
> Dato:14/05/2014 16.53 (GMT+01:00)
> Til: r-h...@stat.math.ethz.ch
> Emne: [R] matrix column division by vector
>
> Hi,
> What is the elegant script to divide t
psed
>>5.040.015.06
>>
>> David C
>>
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
>> Behalf Of Jeff Newmiller
>> Sent: Wednesday, May 14, 2014 10:28 AM
>> To: carol white; carol white; r-
user system elapsed
>5.040.015.06
>
> David C
>
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Jeff Newmiller
> Sent: Wednesday, May 14, 2014 10:28 AM
> To: carol white; carol white;
--Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Jeff Newmiller
Sent: Wednesday, May 14, 2014 10:28 AM
To: carol white; carol white; r-h...@stat.math.ethz.ch
Subject: Re: [R] matrix column division by vector
Please post in plain t
Please post in plain text... your email is getting distorted and hard to read
by the HTML.
I don't know how to use do.call for this, but when you understand how vectors
recycle and matrices and arrays are laid out in memory (read the Introduction
to R document if not) then the following comes t
gt; Texas A&M University
> College Station, TX 77840-4352
>
>
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of carol white
> Sent: Wednesday, May 14, 2014 9:52 AM
> To: r-h...@stat.math.ethz.ch
> S
Have a look at ?sweep
Br. Frede
Sendt fra Samsung mobil
Oprindelig meddelelse
Fra: carol white
Dato:14/05/2014 16.53 (GMT+01:00)
Til: r-h...@stat.math.ethz.ch
Emne: [R] matrix column division by vector
Hi,
What is the elegant script to divide the columns of a matrix by the
mp;M University
College Station, TX 77840-4352
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of carol white
Sent: Wednesday, May 14, 2014 9:52 AM
To: r-h...@stat.math.ethz.ch
Subject: [R] matrix column division by vector
Hi,
What is the
Hi,
What is the elegant script to divide the columns of a matrix by the respective
position of a vector elements?
m=rbind(c(6,4,2),c(3,2,1))
v= c(3,2,1)
res= 6/3 4/2 2/1
3/3 2/2 1/1
this is correct
mat2 = NULL
for (i in 1: ncol(m))
mat2 = cbind(mat2, m[,i]/ v[i])
but
10 matches
Mail list logo