I'm trying to produce some documentation for my tax return and I would need to count how many days I stayed in a country.
Google Location History offers the possibility to download the data and with the aid of some tools, it's possible to extract some meaningful data.
I saw some tools that mainly plotted charts and heatmaps, often made through analysis with R.
How to map your Google location history with R
Would it be possible to:
- Count X amount of days spent in a country (e.g. X days in UK, Y days in Germany, Z days in U.S.A.)
Using the geonames package you can lookup a country code from lat-long:
I would go over your locations and compute the country code, and construct a data frame of data, country code, then use tools in the
dplyr
package to count the number of unique days per country. Not sure how to deal with part-days though...