Re: [R] Element-by-element multiplication

2016-05-22 Thread Jeff Newmiller
outer( p, a ) -- Sent from my phone. Please excuse my brevity. On May 22, 2016 3:34:31 PM PDT, Jim Lemon wrote: >Hi Steven, > >as.data.frame(sapply(a,"*",p)) > >Jim > > >On Mon, May 23, 2016 at 8:22 AM, Steven Yen wrote: >> Dear R users: >> >> > # p is a vector if length 10 >> > # a is a vect

Re: [R] Element-by-element multiplication

2016-05-22 Thread Jim Lemon
Hi Steven, as.data.frame(sapply(a,"*",p)) Jim On Mon, May 23, 2016 at 8:22 AM, Steven Yen wrote: > Dear R users: > > > # p is a vector if length 10 > > # a is a vector if length 3 > > # I like to create a matrix with > > # the first column being p multiplied by a[1] > > # the second colu