#Modified from rutorial from https://www.molecularecologist.com/2014/11/admixture-maps-in-r-for-dummies/
library(maps)
library(plotrix)
#read in file
gps <- read.csv('gps.csv')
#I looked up % B.1.1.7 for MA and CA on 4/14
#from https://covid.cdc.gov/covid-data-tracker/#variant-proportions
#MA was 29.4%, CA was 15.9%
perVariant <- c(.294,.159)
Including Plots
fig.align ="center"
map('state')
map.axes(cex.axis=0.8)
#Add circles to positions in gps.data
points(gps$Longitude, gps$Latitude, cex = 3, col='red',pch=19)
#Change circles to show % for each variant
for (x in 1:nrow(gps)) {
floating.pie(gps$Longitude[x],gps$Latitude[x], #You can modify your loop to reflect this
c(perVariant[x],1-perVariant[x]),radius=2,
col=c("red","blue"))
}
legend(-122,32,legend=c('B.1.17','Other'),col=c('red','blue'), lwd=2, cex=0.8)
title(main = "Percent B.1.1.7 variant in CA and MA",
cex.main = 1.5,
font.main = 3,
col.main="blue",
col.lab = "darkred" )
