In Rb given a vector x
one can find the indices where its elements are TRUE
using the which
function. E.g. y = 1:100
and which(is.even(y))
should return 2,4,...,100
There are also which.max
and which.min
which returns the indices of minimum and maximum values respectiely.
What are their equivalents in Julia?
The find
function does that.
In R:
y = c(1,2,3,4)
which(y > 2)
In Julia:
y = [1, 2, 3, 4]
find(y .> 2)
There is no exact equivalent but findall
There is a comparison list of vocabularies for Julia vs R; which
is on the list
http://www.johnmyleswhite.com/notebook/2012/04/09/comparing-julia-and-rs-vocabularies/
However, according to the list Julia's find
is equivalent to R's which
as answered by others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With