[R] Labelling a fortified GADM map plotted with ggplot and geom_map

2018-03-19 Thread Kenneth Dyson
I am having trouble getting data labels to display over the provinces in a GADM map of Canada. Specifically, I need the variable "Number" from the data set "by_province", grouped by "region", to appear on the corresponding regions of the map. The data set "by_province" looks like this: long

Re: [R] barplot that displays sums of values of 2 y colums grouped by different variables

2018-01-16 Thread kenneth dyson
ot;city n y > mon 100 200 > tor 209 300 > edm 98 87 > mon 20 76 > tor 50 96 > edm 62 27 > ", header = TRUE ) > > dta2 <- (   dta >     %>% group_by( city ) >     %>% summarise( n = sum( n ) > , y = sum( y ) > ) >

[R] barplot that displays sums of values of 2 y colums grouped by different variables

2018-01-15 Thread kenneth dyson
I am trying to create a barplot displaying the sums of 2 columns of data grouped by a variable. the data is set up like this: "city" "n" "y" mon 100 200 tor 209 300 edm 98 87 mon 20 76 tor 50 96 edm 62 27 the resulting plot should have city as the x-axis, 2 bars per city, 1 representing