RfastOfficial / Rfast

A collection of Rfast functions for data analysis. Note 1: The vast majority of the functions accept matrices only, not data.frames. Note 2: Do not have matrices or vectors with have missing data (i.e NAs). We do no check about them and C++ internally transforms them into zeros (0), so you may get wrong results. Note 3: In general, make sure you give the correct input, in order to get the correct output. We do no checks and this is one of the many reasons we are fast.
139 stars 19 forks source link

"harvesine" instead of "haversine" #68

Closed coverton-usgs closed 1 year ago

coverton-usgs commented 1 year ago
          There is a typo in checking "harvesine" method instead of "haversine". I have fix it and it will be chabged from the next update.

For now you can safely just transpose the given argument.

Originally posted by @ManosPapadakis95 in https://github.com/RfastOfficial/Rfast/issues/65#issuecomment-1436985796

Can you explain "transpose the given argument"?

x <- matrix(rnorm(200), nrow = 100, ncol = 2)
d <- Dist(x, method = "harvesine")

Produces "Error: Unsupported Method: harvesine"

ManosPapadakis95 commented 1 year ago

It is self explanatory. Give the matrix but first transposed it.

coverton-usgs commented 1 year ago

Sorry for being obtuse.

Just for clarity for the next hapless searcher

d <- Dist(t(x), method = "haversine")

ManosPapadakis95 commented 1 year ago

Nobody said you are obtuse. This is a temporary solution anyway.