Last updated: 2021-09-24
Checks: 7 0
Knit directory: myTidyTuesday/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20210907)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version c12a2df. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: catboost_info/
Ignored: data/2021-09-08/
Ignored: data/CNHI_Excel_Chart.xlsx
Ignored: data/CommunityTreemap.jpeg
Ignored: data/Community_Roles.jpeg
Ignored: data/YammerDigitalDataScienceMembership.xlsx
Ignored: data/acs_poverty.rds
Ignored: data/fmhpi.rds
Ignored: data/grainstocks.rds
Ignored: data/hike_data.rds
Ignored: data/us_states.rds
Ignored: data/us_states_hexgrid.geojson
Ignored: data/weatherstats_toronto_daily.csv
Untracked files:
Untracked: code/YammerReach.R
Untracked: code/work list batch targets.R
Untracked: figure/
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/CanadaWindTurbines.Rmd
) and HTML (docs/CanadaWindTurbines.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | c12a2df | opus1993 | 2021-09-24 | adopt viridis H color palette |
The data this week comes from the Government of Canada.
Download the weekly data and make available in the tt
object.
tt <- tt_load("2020-10-27")
Downloading file 1 of 1: `wind-turbine.csv`
Let’s take an initial look at the format of the data available. There is a single table this week. Some records appear to be missing.
tt$`wind-turbine`
# A tibble: 6,698 x 15
objectid province_territory project_name total_project_ca~ turbine_identif~
<dbl> <chr> <chr> <dbl> <chr>
1 1 Alberta Optimist Wind~ 0.9 OWE1
2 2 Alberta Castle River ~ 44 CRW1
3 3 Alberta Waterton Wind~ 3.78 WWT1
4 4 Alberta Waterton Wind~ 3.78 WWT2
5 5 Alberta Waterton Wind~ 3.78 WWT3
6 6 Alberta Waterton Wind~ 3.78 WWT4
7 7 Alberta Cowley North 19.5 CON1
8 8 Alberta Cowley North 19.5 CON2
9 9 Alberta Cowley North 19.5 CON3
10 10 Alberta Cowley North 19.5 CON4
# ... with 6,688 more rows, and 10 more variables:
# turbine_number_in_project <chr>, turbine_rated_capacity_k_w <dbl>,
# rotor_diameter_m <dbl>, hub_height_m <dbl>, manufacturer <chr>,
# model <chr>, commissioning_date <chr>, latitude <dbl>, longitude <dbl>,
# notes <chr>
tt$`wind-turbine` %>%
vis_miss()
The turbine identifier and year of objectid
1451 is consistent with the other St. Lawrence project_name
turbines. We will impute the missing value to the dataset as St. Lawrence.
Where turbine rated capacity is missing, the total rated capacity will be assumed to be spread uniformly across all turbines in a project if the model of the turbine is the same. This is the case for Armow Wind Project, South Kent Wind Farm, and Skyway8.
Commissioning_dates are spread in some cases across two or three or even as many as seven years. for the purposes of this analysis, I am going to parse out the right-most, last, date as the allOnlineDate
as an integer.
windTurbine <- tt$`wind-turbine` %>%
mutate(project_name = if_else(objectid == 1451,
"St. Lawrence",
project_name
)) %>%
group_by(project_name) %>%
mutate(
turbine_rated_capacity_k_w =
if_else(is.na(turbine_rated_capacity_k_w),
total_project_capacity_mw * 1000 / n(),
turbine_rated_capacity_k_w
)
) %>%
ungroup() %>%
mutate(allOnlineDate = as.integer(str_sub(
commissioning_date,
str_length(commissioning_date) - 3,
str_length(commissioning_date)
))) %>%
mutate(manufacturer = if_else(str_detect(manufacturer, "Acciona"),
"Acciona",
manufacturer
))
vis_dat(windTurbine)
The notes contain valuable insights. Some specifications may have changed since installation. In other cases, the dataset presented here has other technical assumptions.
windTurbine %>%
filter(!is.na(notes)) %>%
distinct(project_name, notes, province_territory) %>%
knitr::kable(caption = "Canada Wind Farm Data Notes") %>%
kable_minimal(c("striped", "hover", "responsive"))
province_territory | project_name | notes |
---|---|---|
Alberta | Kettles Hill | This farm consists of three different hub heights; with three 50 m turbines, five 60 m turbines, and twenty-seven 67 m turbines. No information available on which turbines fall into which category |
British Columbia | Pennask | Derated from 3200 kW |
British Columbia | Shinish | Derated from 3200 kW |
British Columbia | Moose Lake | Derated from 4200 kW |
Nova Scotia | Little Brook | Hub height approximated from manufacturer specifications |
Nova Scotia | Brookfield | Hub height approximated from manufacturer specifications |
Nova Scotia | Goodwood | Turbine height approximated from manufacturer specifications |
Nova Scotia | Digby Limited | Turbine height approximated from manufacturer specifications |
Nova Scotia | Marshville Limited | Hub height approximated from manufacturer specifications |
Nova Scotia | Tiverton Riverhurst | Turbine height assumed from turbine model |
Nova Scotia | Spiddle Hill | Turbine height assumed |
Nova Scotia | Creignishrear | Turbine height assumed based off turbine model |
Nova Scotia | Irish Mountain | Turbine height estimated |
Nova Scotia | Millbrook | Assumed turbine height based on similar projects/turbines |
Nova Scotia | Truro Heights | Turbine height assumed from turbine model |
Nova Scotia | Cheticamp | Turbine height assumed from turbine model |
Nova Scotia | Fitzpatrick | Turbine derated from 1600 kW. Turbine height approximated from manufacturer specfications |
Nova Scotia | Kemptown | Turbine uprated from 1600 kW |
Nova Scotia | Limerock | Turbine uprated from 1600 kW |
Nova Scotia | North Beaver Bank Community Wind | Turbine derated from 2000 kW |
Nova Scotia | Point Aconi | Assumed turbine model based on rated output. Assumed turbine height based on turbine model |
Nova Scotia | Baddeck | Turbine derated from 2000 kW |
Nova Scotia | Pictou Landing | Assumed turbine height based on turbine model and similar projects |
Ontario | Clear Creek | Turbine height approximated |
Ontario | Cultus | Turbine height approximated |
Ontario | Frogmore | Turbine height approximated |
Ontario | Chatham | 4 of the turbines have 93 ft rotor diameter. Not known which turbines have the smaller rotor |
Ontario | Raleigh Wind Energy Centre | Assumed XLE model. Rotor diameter approximated. |
Ontario | Dufferin Wind | Turbines are derated to levels of 2750/2565/2470/1600/1482/1388/1336 to a farm total of 91.4 MW |
Ontario | Grand Renewable Wind | Wind farm consists of 65 turbines with a nameplate capacity of 2221 kW and 2 turbines with a capacity of 2126 kW. Unknown which turbines have capacity of 2126 kW. |
Ontario | Skyway 8 | All turbines are identical, but 2 operate at 1815 kW and 3 at 1950 kW. No information on which turbines operate at what output. |
Ontario | South Kent Wind Farm | Some turbines derated such that the farm has a maximum operating capacity of 270 MW |
Ontario | Armow Wind Project | Some turbines derated such that the farm has an maximum operating capacity of 180 MW |
Ontario | Bow Lake Wind Project | Turbines uprated from 1600 kW |
Ontario | Port Ryerse | Turbines derated from 3000 kW |
Ontario | Belle River | Some turbines derated such that wind farm has maximum capacity of 100 MW |
Ontario | North Kent Wind Farm | Turbine derated from 3200 kW |
A count of turbines by manufacturer.
windTurbine %>%
group_by(manufacturer) %>%
summarize(
Turbines = n(),
`Total Installed Capacity in kW` = sum(turbine_rated_capacity_k_w)
) %>%
arrange(desc(Turbines)) %>%
knitr::kable(caption = "Canada Wind Power Turbine Manufacturers") %>%
kable_minimal(c("striped", "hover", "responsive"))
manufacturer | Turbines | Total Installed Capacity in kW |
---|---|---|
Vestas | 1834 | 3542350 |
GE | 1725 | 2819540 |
Siemens | 1248 | 2902736 |
Enercon | 960 | 2193980 |
Senvion | 643 | 1354450 |
NEG Micon | 132 | 99000 |
Acciona | 74 | 177000 |
Nordex | 20 | 26000 |
Suzlon | 15 | 31500 |
Vensys | 9 | 12300 |
Gamesa | 8 | 16000 |
Windmatic | 6 | 390 |
DeWind | 5 | 10000 |
Samsung Renewable Energy | 4 | 10000 |
Northwind | 3 | 300 |
Turbowinds | 3 | 1800 |
Bonus | 2 | 300 |
EWT | 2 | 1800 |
Lagerwey | 2 | 1500 |
Leitwind | 1 | 1500 |
Pfleiderer | 1 | 650 |
Tacke | 1 | 600 |
Lets build an area chart showing the growth in capacity with an inset map:
western_turbines <- filter(windTurbine, province_territory %in% c("Alberta", "British Columbia", "Manitoba", "Saskatchewan"))
p1 <- western_turbines %>%
select(
province_territory,
allOnlineDate,
turbine_rated_capacity_k_w
) %>%
group_by(province_territory, allOnlineDate) %>%
summarize(
SumCapacity = sum(turbine_rated_capacity_k_w),
.groups = "drop"
) %>%
complete(allOnlineDate,
province_territory,
fill = list(SumCapacity = 0)
) %>%
group_by(province_territory) %>%
mutate(CumSumCapacity = cumsum(SumCapacity)) %>%
ungroup() %>%
ggplot() +
geom_area(aes(
x = allOnlineDate,
y = CumSumCapacity / 1000,
fill = province_territory
), show.legend = FALSE) +
scale_y_continuous(
labels = scales::comma_format(),
position = "right",
expand = c(0, 0)
) +
scale_x_continuous(
limits = c(1995, 2019),
expand = c(0, 0)
) +
labs(
y = "", x = "", fill = "",
title = "Wind Power in Canada's Western Provinces",
subtitle = "Cumulative sum of MW of power capacity installed at project completion",
caption = "Data: Government of Canada | Visualization: @jim_gruman"
)
Where are these turbines?
Can we take a look at turbines in the western provinces?
adapted from Jake Kaupp’s TidyTuesday submission this week on the Maritime provinces
western_provinces <- ne_states("Canada", returnclass = "sf") %>%
filter(name %in% c("Alberta", "British Columbia", "Manitoba", "Saskatchewan"))
wp_box <- st_bbox(western_provinces)
western_bbox <- matrix(c(wp_box[1], wp_box[3], wp_box[2], max(western_turbines$latitude) + 1), nrow = 2, ncol = 2)
western_hwy <- western_bbox %>%
opq(timeout = 6000) %>%
add_osm_feature(
key = "highway",
value = c("primary", "secondary", "tertiary", "secondary_link", "tertiary_link")
) %>%
osmdata_sf()
western_hwy_clipped <- st_intersection(western_hwy$osm_lines, western_provinces)
p2 <- ggplot() +
geom_sf(data = western_provinces, inherit.aes = FALSE, color = "#2F394D", fill = "white") +
geom_sf(data = western_hwy_clipped, inherit.aes = FALSE, color = "#403d58", size = 0.1) +
geom_point(data = western_turbines, aes(x = longitude, y = latitude, color = province_territory), alpha = 0.4, size = 4, show.legend = FALSE) +
geom_richtext(aes(
x = -130, y = 58.4,
label = "The wind turbines built since 1995 as part of<br>larger wind farm projects in <span style='color:#F1CA3AFF'>British Columbia</span>,<br> <span style='color:#7A0403FF'>Alberta</span>, <span style='color:#BE2102FF'>Saskatchewan</span> and <span style='color:#1FC8DEFF'>Manitoba</span>."
), fill = "white", hjust = 0, label.color = NA, size = 5, color = "#464950", family = "Roboto Condensed") +
labs(x = "", y = "") +
scale_size_area(max_size = 6) +
theme_map()
ggdraw(p1) +
draw_plot(p2, 0, .3, .7, .7)
And my tweet from that week:
tweetrmd::include_tweet("https://twitter.com/jim_gruman/status/1321922270072328192")
Built this week's #TidyTuesday set into a quick inset map of Western Canada's wind turbines with {cowplot}. code @ https://t.co/DvWAyxrsU4 #r4ds #rstats pic.twitter.com/ILa3qiXQDI
— Jim Gruman📚🚵♂️⚙ (@jim_gruman) October 29, 2020
sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] cowplot_1.1.1 ggtext_0.1.1 rnaturalearth_0.1.0
[4] sf_1.0-2 osmdata_0.1.6 kableExtra_1.3.4
[7] visdat_0.5.3 naniar_0.6.1 tidytuesdayR_1.0.1
[10] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7
[13] purrr_0.3.4 readr_2.0.1 tidyr_1.1.3
[16] tibble_3.1.4 ggplot2_3.3.5 tidyverse_1.3.1
[19] workflowr_1.6.2
loaded via a namespace (and not attached):
[1] readxl_1.3.1 backports_1.2.1 systemfonts_1.0.2
[4] workflows_0.2.3 selectr_0.4-2 plyr_1.8.6
[7] sp_1.4-5 splines_4.1.1 listenv_0.8.0
[10] usethis_2.0.1 digest_0.6.27 foreach_1.5.1
[13] htmltools_0.5.2 yardstick_0.0.8 viridis_0.6.1
[16] parsnip_0.1.7.900 fansi_0.5.0 magrittr_2.0.1
[19] tune_0.1.6 tzdb_0.1.2 recipes_0.1.16
[22] globals_0.14.0 modelr_0.1.8 gower_0.2.2
[25] extrafont_0.17 vroom_1.5.5 R.utils_2.10.1
[28] extrafontdb_1.0 svglite_2.0.0 hardhat_0.1.6
[31] rsample_0.1.0 dials_0.0.10 colorspace_2.0-2
[34] rvest_1.0.1 textshaping_0.3.5 haven_2.4.3
[37] xfun_0.26 crayon_1.4.1 jsonlite_1.7.2
[40] survival_3.2-11 iterators_1.0.13 glue_1.4.2
[43] gtable_0.3.0 ipred_0.9-12 webshot_0.5.2
[46] R.cache_0.15.0 tweetrmd_0.0.9 Rttf2pt1_1.3.9
[49] future.apply_1.8.1 scales_1.1.1 infer_1.0.0
[52] DBI_1.1.1 Rcpp_1.0.7 viridisLite_0.4.0
[55] gridtext_0.1.4 units_0.7-2 bit_4.0.4
[58] GPfit_1.0-8 proxy_0.4-26 lava_1.6.10
[61] prodlim_2019.11.13 httr_1.4.2 wk_0.5.0
[64] ellipsis_0.3.2 farver_2.1.0 R.methodsS3_1.8.1
[67] pkgconfig_2.0.3 nnet_7.3-16 sass_0.4.0
[70] dbplyr_2.1.1 utf8_1.2.2 here_1.0.1
[73] labeling_0.4.2 tidyselect_1.1.1 rlang_0.4.11
[76] DiceDesign_1.9 later_1.3.0 cachem_1.0.6
[79] munsell_0.5.0 cellranger_1.1.0 tools_4.1.1
[82] cli_3.0.1 generics_0.1.0 broom_0.7.9
[85] evaluate_0.14 fastmap_1.1.0 ragg_1.1.3
[88] yaml_2.2.1 bit64_4.0.5 knitr_1.34
[91] fs_1.5.0 s2_1.0.6 future_1.22.1
[94] whisker_0.4 R.oo_1.24.0 xml2_1.3.2
[97] compiler_4.1.1 rstudioapi_0.13 curl_4.3.2
[100] e1071_1.7-8 reprex_2.0.1 lhs_1.1.3
[103] bslib_0.3.0 stringi_1.7.4 highr_0.9
[106] rgeos_0.5-7 gdtools_0.2.3 hrbrthemes_0.8.0
[109] lattice_0.20-44 rnaturalearthhires_0.2.0 Matrix_1.3-4
[112] markdown_1.1 styler_1.6.1 classInt_0.4-3
[115] conflicted_1.0.4 vctrs_0.3.8 tidymodels_0.1.3
[118] pillar_1.6.2 lifecycle_1.0.0 furrr_0.2.3
[121] jquerylib_0.1.4 httpuv_1.6.3 R6_2.5.1
[124] promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3
[127] parallelly_1.28.1 codetools_0.2-18 MASS_7.3-54
[130] assertthat_0.2.1 rprojroot_2.0.2 withr_2.4.2
[133] parallel_4.1.1 hms_1.1.0 grid_4.1.1
[136] rpart_4.1-15 timeDate_3043.102 class_7.3-19
[139] rmarkdown_2.11 git2r_0.28.0 pROC_1.18.0
[142] lubridate_1.7.10