Scraping and plotting sunrise times in R.
If you don't like to get up when it's still dark, use this script to see, how many days per year you can get up after sunrise depending on what city you choose to live in.
The script works as follows:
- User inputs his usual get up time
- User is asked to consider up to 6 cities
- The script scrapes timeanddate.com for necessary information
- The script plots sunrise times across year 2017, calculates how many days pro year the user would get up after sunrise in each city and returns the best city
External data: cities_base.txt, countries_base.txt (Google Drive)
Libraries: XML, httr, chron