[R] Multiplying two vectors of the same size to give a third vector of the same size
ph|| @end|ng |rom pr|com@com@@u
Tue Jun 20 19:52:32 CEST 2023
On 2023-06-21 03:31, Bert Gunter wrote:
> You need to do your due diligence. This list is not meant to serve as
> a substitute for learning the basics of R, which you have clearly not
> done. Please go through an R tutorial or two (there is even one that
> ships with R, "An Inroduction to R") before posting further here.
> There are many good ones online, of course. Here is one compendium,
> but a simple search will find many more:
It has been a long time since I looked at R and I thought at least my
second Q was something reasonable to ask the list?
Anyway now that I need to use R again, the basics should come back to me
I hope - but I will check out the tutorials again in any case . .
Thanks to Uwe as well (very nice!),
> On Tue, Jun 20, 2023 at 8:38 AM Philip Rhoades via R-help
> <r-help using r-project.org> wrote:
>> I am assuming that what I want to do is easier in R than say Ruby.
>> I want to do what the Subject says ie multiply the cells in the same
>> position of two vectors (A and B) to give a result in the same
>> in a third vector (C) BUT:
>> - The values in the cells of A and B are floats between 0.0 and 1.0
>> - If there is a NULL in the multiplication, then the result in the
>> for C is also a NULL
>> - If there is a value less than (say) 0.01 in the multiplication,
>> the result in the cell for C is 0.0
>> Any suggestions appreciated!
>> Philip Rhoades
>> PO Box 896
>> Cowra NSW 2794
>> E-mail: phil using pricom.com.au
>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
PO Box 896
Cowra NSW 2794
E-mail: phil using pricom.com.au
More information about the R-help