0

I want to make a map and pie combination using R and my own data. here is the link to my data. https://drive.google.com/open?id=1HVpFiwdj6YxDDkoq6PmAYMh9_Q6LR95L

My objective is to bring out something like this- enter image description here

I have tried various libraries and I am still trying, but not able to get the same,

Here are my small datasets 1. https://drive.google.com/open?id=1oR99mHsTbm86KEUfs-U3UnbczooIS-E_ 2. https://drive.google.com/open?id=18B-ehTdcCPcpOqGW_0-nnRf2Ft_nIIxr

library(xlsx)
library(ggplot2)
library(maps)
library(ggthemes)
library(mapdata)
library(raster)
library(rgeos)
library(scatterpie)


world <- map_data('world', 'canada')
p <- ggplot(world, aes(long, lat)) +
    geom_map(map=world, aes(map_id=region), fill='grey', color="black") +
    coord_quickmap()
p + geom_scatterpie(aes(x=Longitude, y=Latitude,  group=Name), data=df, 
                           cols=c('Calgary', 'Cobourg', 'Cornwall', 'Dieppe', 'Etobicoke', 'Grande.Prairie', 'Lloydminster', 'Mississauga', 'Newmarket', 'North.York', 
                                    'Oakville', 'Oshawa', 'Ottawa', 'Pickering', 'Red.Deer', 'Richmond.Hill', 'Salmon.Arm', 'Saskatoon', 'Scarborough', 'Stouffville', 
                                    'Surrey', 'Toronto', 'Vancouver', 'Victoria', 'Whitby', 'Woodbridge'), color=NA) + coord_equal()+
  coord_fixed() +
  theme_fivethirtyeight() 

I am still trying, any suggestions please. Thanks

Ayman Alawin
  • 93
  • 1
  • 10
  • In case you can't see the deleted post in the link: [scatterpie: scatter pie plot](https://cran.r-project.org/web/packages/scatterpie/vignettes/scatterpie.html) – Henrik Jun 18 '18 at 09:05
  • @Henrik i HAVE USED THEM ALL, BUT I AM NOT ABLE TO CREATE THE SAME. – Ayman Alawin Jun 18 '18 at 10:48
  • @Henrik I have updated my code, but still the chart is of no similar nature – Ayman Alawin Jun 18 '18 at 12:50
  • The code still isn't reproducible, though, so we still can't tell what's going wrong. Put a small version of your data set in the post, and make the example as simple as possible (for example, maybe some of those libraries you don't need)? – Aaron left Stack Overflow Jun 18 '18 at 16:38

0 Answers0