Skip to content
Prev 321874 / 398500 Next

Using different function (parameters) with apply

On 18-04-2013, at 07:20, Sachinthaka Abeywardana <sachin.abeywardana at gmail.com> wrote:

            
column 1 is c(1,2,3) and divided by your vector div gives the first column c(1/1,2/2,3/3) = c(1,1,1) and that is correct.
column 3 is c(7,8,9) and divided by vector div gives c(7/1, 8/2 , 9/3) = c(7,4,3). Also correct.
You are dividing each row by vector div). The result for row 1 is the first column and so forth.
Probably if you did t(?) you would get what you want/expect.
Your conclusions are incorrect.
What is the result that you want (or expect)?

Berend