#Modified from tutorial from https://www.molecularecologist.com/2014/11/admixture-maps-in-r-for-dummies/
#load libraries
library(maps)
library(plotrix)

Including Plots

#I looked up % variants for Wisconsin on May 5th
#from https://covid.cdc.gov/covid-data-tracker/#variant-proportions

#Instead of using variables to store GPS latitude, GPS longitude, and variant proportions, I typed in the values

#Since I wasn't storing the information in vectors I did not use a loop

fig.align ="center"
map('state')
map.axes(cex.axis=0.8)

#Add single pie chart with multiple slices
floating.pie(-89.384444,43.074722, #GPS coordinates
             c(0.432,0.016,0.097,0.026,0.429), #Use c() to list %s
             radius=2, #set size of pie chart
             col=c("chartreuse","chocolate1","dodgerblue","darkorchid1","khaki1")) #Use c() to list colors in pie

legend(-125,35,legend=c('B.1.1.7','B.1.351','B.1.427/B.1.429','P.1.','Other'),col=c("chartreuse","chocolate1","dodgerblue","darkorchid1","khaki1"), lwd=2, cex=0.6)


title(main = "Percent variants in WI on 5/5/2021",
      cex.main = 1.5,
      font.main = 3,
      col.main="blue",
      col.lab = "darkred" )