R>> hans>> 返回
项目作者: alexhallam

项目描述 :
:globe_with_meridians: A fast dataframe compatible haversine function
高级语言: C++
项目地址: git://github.com/alexhallam/hans.git
创建时间: 2019-09-26T20:01:05Z
项目社区:https://github.com/alexhallam/hans

开源协议:Other

下载


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:

  1. install.packages("hans")

Example

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

  1. library(tibble)
  2. library(dplyr)
  3. library(magrittr)
  4. set.seed(42)
  5. lon1 <- runif(-160, -60, n = 1e6)
  6. lat1 <- runif(40, 60, n = 1e6)
  7. lon2 <- runif(-160, -60, n = 1e6)
  8. lat2 <- runif(40, 60, n = 1e6)
  9. df <- tibble::tibble(lat1, lon1, lat2, lon2) %>%
  10. mutate(hav = haversine(lat1, lon1, lat2, lon2))

Performance