Re: [R] rtriang using ifelse statement

2012-03-17 Thread David Winsemius
On Mar 17, 2012, at 3:22 PM, Diann Prosser wrote: Thank you for that explanation and solution David. As a follow-up to ifelse working on vectors, earlier I tried to coerce (?correct term?) the matrix into a vector but I still received the same result. You can certainly "coerce" a matrix t

Re: [R] rtriang using ifelse statement

2012-03-17 Thread Peter Ehlers
Slight correction to David's answer. See inline below. On 2012-03-17 11:49, David Winsemius wrote: On Mar 17, 2012, at 2:36 PM, Diann Prosser wrote: Hi All, I want to draw samples (n=4) from one of 2 triangular distributions for each value in a matrix. I am using an ifelse statement to try

Re: [R] rtriang using ifelse statement

2012-03-17 Thread Diann Prosser
Thank you for that explanation and solution David. As a follow-up to ifelse working on vectors, earlier I tried to coerce (?correct term?) the matrix into a vector but I still received the same result. Should the following work, or does as.vector not work that way, even though vect now prints as

Re: [R] rtriang using ifelse statement

2012-03-17 Thread David Winsemius
On Mar 17, 2012, at 2:36 PM, Diann Prosser wrote: Hi All, I want to draw samples (n=4) from one of 2 triangular distributions for each value in a matrix. I am using an ifelse statement to try to define which distribution to draw from. From the output, I can see that the ifelse statement