Title: | Effortlessly Create Stunning Canadian Maps |
---|---|
Description: | Simple and seamless access to a variety of 'StatCan' shapefiles for mapping Canadian provinces, regions, forward sortation areas, census divisions, and subdivisions using the popular 'ggplot2' package. |
Authors: | Joelle Cayen [aut, cre] |
Maintainer: | Joelle Cayen <[email protected]> |
License: | MIT + file LICENSE |
Version: | 2.0.0 |
Built: | 2025-02-26 04:00:45 UTC |
Source: | https://github.com/joellecayen/canadianmaps |
Provides geospatial information for all Canadian census divisions.
CD
CD
A data frame with 293 rows and 7 variables:
Census Division names
ID column for each province
id for geometry
Population from 2021 Census
province or territory
Province name
map geometry
...
Converts your longitude and latitude coordinates to match the maps to properly overlay.
coord_transform(data, long, lat)
coord_transform(data, long, lat)
data |
a data set with long and lat coordinates |
long |
the longitude variable name |
lat |
the latitude variable name |
Your coordinates transformed.
Used to visualize simple feature (sf) objects. Required to plot geometry objects.
crs_coord()
crs_coord()
a coordinate system for mapping
Provides geospatial information for all Canadian census sub divisions.
CSD
CSD
A data frame with 5161 rows and 9 variables:
Census Division names
ID column for each province
Census Division ID
CMA ID
id for geometry
Population from 2021 Census
province or territory
Province name
map geometry
...
Provides geospatial information for all Canadian Forward sortation areas (FSA).
FSA
FSA
A data frame with 1614 rows and 6 variables:
ID column for each FSA code
Province name
ID column for each province
province or territory
id for geometry
map geometry
...
Maps CD data using Statistics Canada CD shape file.
geom_cd(data = CD, fill = "PRNAME", colour = "white", size = 0.2)
geom_cd(data = CD, fill = "PRNAME", colour = "white", size = 0.2)
data |
a data set with geometry variable |
fill |
the color fill variable |
colour |
outline color, default is NA |
size |
size of outline |
census division map.
Maps CSD data using Statistics Canada CSD shape file.
geom_csd(data = CSD, fill = "PRNAME", colour = "white", size = 0.2)
geom_csd(data = CSD, fill = "PRNAME", colour = "white", size = 0.2)
data |
a data set with geometry variable |
fill |
the color fill variable |
colour |
outline color, default is NA |
size |
size of outline |
census subdivision map.
Maps FSA data using Statistics Canada FSA shape file.
geom_fsa(data = FSA, fill = "PRNAME", colour = "white", size = 0.2)
geom_fsa(data = FSA, fill = "PRNAME", colour = "white", size = 0.2)
data |
a data set with geometry variable |
fill |
the color fill variable |
colour |
outline color, default is NA |
size |
size of outline |
FSA map.
Maps HR data using Statistics Canada HR shape file.
geom_hr(data = HR, fill = "PRNAME", colour = "white", size = 0.2)
geom_hr(data = HR, fill = "PRNAME", colour = "white", size = 0.2)
data |
a data set with geometry variable |
fill |
the color fill variable |
colour |
outline color, default is NA |
size |
size of outline |
HR map.
Maps provincial data using Statistics Canada province shape file.
geom_prov(data = PROV, fill = "PT", colour = NA, size = 0.1)
geom_prov(data = PROV, fill = "PT", colour = NA, size = 0.1)
data |
a data set with geometry variable |
fill |
the color fill variable |
colour |
outline color, default is NA |
size |
size of outline |
Provincial map.
Maps regional data using Statistics Canada province shape file.
geom_reg(data = REG, fill = "region", colour = NA, size = 0.1)
geom_reg(data = REG, fill = "region", colour = NA, size = 0.1)
data |
a data set with geometry variable |
fill |
the color fill variable |
colour |
outline color, default is NA |
size |
size of outline |
Regional map.
Provides geospatial information for all Health Regions areas (HR).
HR
HR
A data frame with 104 rows and 8 variables:
ID column for each HR code
Health Region english name
Health Region french name
id for geometry
map geometry
province or territory
Province name
ID column for each province
...
Adds text labels in the center of each province with light gray bubble.
label_prov( data = PROV, label = "PT", colour = "grey20", size = 3, outline = NA, alpha = 0.7 )
label_prov( data = PROV, label = "PT", colour = "grey20", size = 3, outline = NA, alpha = 0.7 )
data |
a data set with geometry variable |
label |
the label variable |
colour |
label color |
size |
label size |
outline |
outline color |
alpha |
transparency |
Provincial map labels
Adds text labels in the center of each region with light gray bubble.
label_reg(data = REG, label = "region", colour = "grey20", size = 4)
label_reg(data = REG, label = "region", colour = "grey20", size = 4)
data |
a data set with geometry variable |
label |
the label variable |
colour |
label color |
size |
label size |
Regional map labels.
Provides geospatial information for all 13 Canadian provinces and territories.
PROV
PROV
A data frame with 13 rows and 12 variables:
Province abbreviated English
Province name English
Province abbreviated French
Province name French
Province name
ID column for each province
province or territory
national region
center of shape x axis
center of shape y axis
id for geometry
map geometry
...
Provides geospatial information for all 4 regions of Canada (Central, Eastern, Western, and Northern).
REG
REG
A data frame with 13 rows and 12 variables:
Province abbreviated English
Province name English
Province abbreviated French
Province name French
Province name
ID column for each province
province or territory
national region
center of shape x axis
center of shape y axis
id for geometry
map geometry
...
Create a custom number of colors to use for graphing or mapping based on preset color palettes.
scale_color_map(palette, num, na.value = "grey90", rev = FALSE)
scale_color_map(palette, num, na.value = "grey90", rev = FALSE)
palette |
color palette name |
num |
number of colors to create |
na.value |
a color value for NA, defaults to light gray |
rev |
condition to reverse the order of the colors |
a ggplot color palette
Create a custom number of colors to use for graphing or mapping based on preset color palettes.
scale_fill_map(palette, num, na.value = "grey90", rev = FALSE)
scale_fill_map(palette, num, na.value = "grey90", rev = FALSE)
palette |
color palette name |
num |
number of colors to create |
na.value |
a color value for NA, defaults to light gray |
rev |
condition to reverse the order of the colors |
a ggplot color palette
Adds text labels in the center of each province.
text_prov(data = PROV, label = "PT", colour = "grey20", size = 3)
text_prov(data = PROV, label = "PT", colour = "grey20", size = 3)
data |
a data set with geometry variable |
label |
the label variable |
colour |
text color |
size |
text size |
Provincial map labels
Blank theme to apply for mapping using ggplot2.
theme_map(base_size = 9, base_family = "")
theme_map(base_size = 9, base_family = "")
base_size |
size for text |
base_family |
font for text |
A blank theme for ggplot
Custom theme to apply for plotting using ggplot2.
theme_wallis()
theme_wallis()
A theme for ggplot