Learn R Programming

eddington

One statistic that cyclists are known to track is their Eddington number. The Eddington number for cycling, E, is the maximum number where a cyclist has ridden E miles on E distinct days. So to get a number of 30, you need to have ridden 30 miles or more on 30 separate days.

This package provides functions to compute a cyclist’s Eddington number, including efficiently computing cumulative E over a vector. These functions may also be used for h-indices for authors. Both are specific applications of computing the side length of a Durfee square.

The package can also be used to ingest GPS Exchange Format (GPX) files into a data.frame format conducive to computing the Eddington number.

Installation

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

install.packages("eddington")

And the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("pegeler/eddington2/R/package")

Example

Here is a basic example showing how to get the summary Eddington number of the included simulated rides dataset. Note that we first have to aggregate ride mileage by date.

library(eddington)
library(dplyr)

rides %>%
  group_by(ride_date) %>%
  summarize(n = n(), total = sum(ride_length)) %>% 
  summarize(E = E_num(total)) %>% 
  pull
#> [1] 29

See the package vignette for detailed usage.

Copy Link

Version

Install

install.packages('eddington')

Monthly Downloads

194

Version

4.2.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Paul Egeler

Last Published

August 16th, 2024

Functions in eddington (4.2.0)

rides

A year of simulated bicycle ride mileages
read_gpx

Read a GPX file into a data frame containing dates and distances
get_haversine_distance

Compute the distance between two points using the Haversine formula
E_req

Determine the number of additional rides required to achieve a specified Eddington number
E_cum

Calculate the cumulative Eddington number
E_next

Get the number of rides required to increment to the next Eddington number
EddingtonModule

An Rcpp Module for Tracking Eddington Numbers for Cycling
E_sat

Determine if a dataset satisfies a specified Eddington number
E_num

Get the Eddington number for cycling
Eddington

An R6 Class for Tracking Eddington Numbers for Cycling