avi,
On 2023-06-21 12:46, avi.e.gr...@gmail.com wrote:
I was rushing out Phil so let me amend what I wrote. As others noted,
this is fairly beginner stuff. If you have more such questions,
besides reading up, please consider sending questions to the Tutor
mailing list where there is more patien
I was rushing out Phil so let me amend what I wrote. As others noted, this is
fairly beginner stuff. If you have more such questions, besides reading up,
please consider sending questions to the Tutor mailing list where there is more
patience. 😉
You wanted to change selected small values to 0.0
Eric,
On 2023-06-21 04:02, Eric Berger wrote:
Hi Philip,
In the decades since you learned R there have been some additions to
the language.
In particular, R now supports lambda functions.
Applying this feature to Ivan's beautiful solution cuts down 7
characters (continuing his golfing analogy)
Hi Philip,
In the decades since you learned R there have been some additions to the
language.
In particular, R now supports lambda functions.
Applying this feature to Ivan's beautiful solution cuts down 7 characters
(continuing his golfing analogy)
unlist(lapply(seq_along(x), \(i) x[i] * x[-(1:i)]
Bert,
On 2023-06-21 03:31, Bert Gunter wrote:
IMO:
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"
Ivan,
On 2023-06-21 03:32, Ivan Krylov wrote:
Ð’ Wed, 21 Jun 2023 03:13:52 +1000
Philip Rhoades via R-help пишет:
This:
!(1,2,3,4,5)
would give this:
(2,3,4,5, 6,8,10, 12,15, 20)
Do you mean taking a product of every element of the vector with all
following vector elements? A relat
vf <- function(x){
o <- outer(x, x)
as.vector(na.omit(o[lower.tri(o)]))
}
vf(1:5)
vf(c(1,2,NA,4,5))
Best,
Uwe Ligges
On 20.06.2023 19:13, Philip Rhoades via R-help wrote:
People,
What I mean is, is there an elegant way to do this:
This:
 !(1,2,3,4,5)
would give this:
 (2,3,4,5,
Well, I think this is reasonable elegant, but ymmv. Turning it into a
function and removing NA values is left for you.
> x <- 1:5
> unlist(sapply(seq(1, length(x) - 1), function(i){x[i] * x[seq(i + 1,
> length(x))]}))
[1] 2 3 4 5 6 8 10 12 15 20
>
> x <- c(1, 2, NA, 4, 5)
> unlist(sapply(s
Ð’ Wed, 21 Jun 2023 03:13:52 +1000
Philip Rhoades via R-help пишет:
> This:
>
>!(1,2,3,4,5)
>
> would give this:
>
>(2,3,4,5, 6,8,10, 12,15, 20)
Do you mean taking a product of every element of the vector with all
following vector elements? A relatively straightforward way would be
(gi
IMO:
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
People,
What I mean is, is there an elegant way to do this:
This:
!(1,2,3,4,5)
would give this:
(2,3,4,5, 6,8,10, 12,15, 20)
and this:
!(1,2,NA,4,5)
would give this:
(2,4,5, 8,10, 20)
?
Thanks!
Phil.
--
Philip Rhoades
PO Box 896
Cowra NSW 2794
Australia
E-mail: p...@pricom.
avi,
On 2023-06-21 01:55, avi.e.gr...@gmail.com wrote:
Phil,
What have you tried. This seems straightforward enough.
Could you clarify what you mean by NULL?
I guess in R in would just be an empty cell? - ie NOT a zero.
In R, it is common to use NA or a more specific version of it.
A
Phil,
What have you tried. This seems straightforward enough.
Could you clarify what you mean by NULL?
In R, it is common to use NA or a more specific version of it.
So assuming you have two vectors containing floats with some NA, then:
C <- A*B
Will give you the products one at a time if the
People,
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 position
in a third vector (C) BUT:
- The values in the cells of A and B are floats b
Dear Ivan,
Yes, you were rightthe native BLAS version of my ubuntu
system is:
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
Updating BLAS with ropenblas(), as you said,is superfi
15 matches
Mail list logo