Skip to content

🌐 A fast dataframe compatible haversine function

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

alexhallam/hans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hans

CRAN version

The goal of hans is to make a fast dataframe compatible haversine function.

Installation

You can install the released version of hans from CRAN with:

install.packages("hans")

Example

This is a basic example which shows you how to solve a common problem:

library(tibble)
library(dplyr)
library(magrittr)

set.seed(42)
lon1 <- runif(-160, -60, n = 1e6)
lat1 <- runif(40, 60, n = 1e6)
lon2 <- runif(-160, -60, n = 1e6)
lat2 <- runif(40, 60, n = 1e6)

df <- tibble::tibble(lat1, lon1, lat2, lon2) %>% 
  mutate(hav = haversine(lat1, lon1, lat2, lon2))

Performance

About

🌐 A fast dataframe compatible haversine function

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published