Skip to content

Instantly share code, notes, and snippets.

@jsta
Created November 24, 2017 21:18
Show Gist options
  • Select an option

  • Save jsta/b319800a18bdd691a0fe3d5e13bb0659 to your computer and use it in GitHub Desktop.

Select an option

Save jsta/b319800a18bdd691a0fe3d5e13bb0659 to your computer and use it in GitHub Desktop.
How many times over can Loch Ness hold the volume of the world population?
library(wikilake)
library(wbstats)
library(dplyr)
dt <- lake_wiki("Loch Ness")
loch_volume <- as.numeric(substring(dt$`Water volume`, 0, 3))
pop_data <- wb(indicator = "SP.POP.TOTL", startdate = 2016, enddate = 2017)
pop_data <- filter(pop_data, country == "World")
# https://www.cdc.gov/nchs/fastats/body-measurements.htm
men_volume <- 175.768 * (101.5 / (2 * pi))^2 * pi
women_volume <- 161.798 * (96.9 / (2 * pi))^2 * pi
person_volume <- ((pop_data$value / 2) * men_volume) + ((pop_data$value / 2) * women_volume)
person_volume <- person_volume * 1e-15 # cm3 to km3
loch_volume / person_volume
@jsta

jsta commented Nov 24, 2017

Copy link
Copy Markdown
Author

7.6 times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment