c4bi
c4bi.Rmd
Science is meant to be shared! c4bi and its accompanying publication provide a framework, workflow, code, and examples to faciliate knowledge exchange between ecologists and their stakeholders. It’s often time consuming and tedious to create hundreds of plots and unique research summaries when data is collected across dozens of stakeholder sites. The template code here will help you more readily prepare your dataset(s) to create individualized reports in .html documents that can be distributed to your stakeholders via print or digital media.
report_code folder and copy them to your local computer. Alternatively, you can delete files from the repository on your local device as needed after you learn the gist of workflow. The instructions below apply if you are working with the entire repository..R Script file for the template or case study..R Script by setting the working directory to the c4bi repository.install.packages("dplyr")
install.packages("ggplot2")
install.packages("rmarkdown")
install.packages("reshape2")
install.packages("tidyr")
install.packages("kableExtra")
install.packages("here")
install.packages("ggsci")
install.packages("RColorBrewer")
install.packages("plyr")
install.packages("knitr")
.R Script..html documents are generated in the report_ouput folder in your working directory. If not, then work through the steps again..R Script as needed for your project..Rmd file within the same folder for the .R script you are working with..Rmd as needed for your project.render() function to whatever location works best for you. Note: the .Rmd and .R file should be located in the same path as the location for your report outputs..R and .Rmd pair of files in the report_code/template folder with 3 sample reports. This template code uses a simulated, heuristic dataset of bird and tree counts across three parks in three towns. Birds were sampled in each park for 10 days. We plot these data in individualized plots across the three towns to following the Coding for broader impact framework, which encourages highlighting each site in the context of the entire study for helpful comparisons. The data for the template code is available by cloning/downloading the repository.
.R, .Rmd, and .html files described below can be found in the Template + Case Studies tab..rda files in this package can be found in the Data tab.This case study summarizes biodiversity surveys for reptiles, amphibians, birds, and arthropods at homes and undeveloped natural sites across the Caribbean island of Curaçao. We contextualize each of 31 focal sites by comparing diversity on the focal site to diversity across sites in a variety of land use categories. In the /report_code/homeowner_reports folder, you will find an .R script, an .Rmd script, and 3 sample reports as .html documents, which can be opened in any Internet browser. We used Chrome to print these .html files to pdfs, which we then assembled with other documents and then created bound paper reports that we distributed to home owners. The data files used with the .R and .Rmd are located as .rda files in the data folder and in raw .csv form in the data_raw folder. By cloning the repository, you will already be able to load the .rda files in the respective .R and .Rmd files.
This case study summarizes biodiversity surveys for beneficial predatory arthropods on organic farms across an urbanization gradient in southeastern Pennsylvania. We contextualize each of 15 focal farms across categories of urbanization intensity. In this case study, we provided two reports to each farmer. The first report provided summary diversity metrics of what was found on each farm in comparison to other farms. The second report was in respones to feedback from farmers about the first report. In the /report_code/farmer_reports_iter1 folder, you will find an .R script, an .Rmd script, and 6 sample reports as .html documents for this first round of reports. This second report focuses on land management strategies that promote beneficial arthropod diversity. In the /report_code/farmer_reports_iter2 folder, you will find an .R script, an .Rmd script, and 3 sample reports as .html documents for the second round of reports.
This case study summarizes tick-borne diseases and host diversity in forest patches around southeastern Pennsylvania. We contextualize multiple sites for each of six stakeholders and compare their data across county means. In the /report_code/tick_reports folder, you will find an .R script, an .Rmd script, and 6 sample reports as .html documents. We converted these .html documents to .pdf documents rapidly through a loop using pagedown::chrome_print() before distribution to property managers.
This package is distributed as is. Please see the feedback information below if you would like to add a feature or if you found a bug. We welcome feedback.
Please read and follow these simple rules before submitting a feature, bug or pull request. (these rules are blatantly copied from here)
If you have a new idea for how the scripts should be restructured, please open an issue (tagged ‘enhancement’) to discuss it first before making a pull request.
If you you’ve found a bug, open an issue (tagged ‘bug’) that contains a minimal, complete, and verifiable example. We’ll try and get back to you quickly. If you are able to solve the bug on your own, please post the correction.
If you have a feature request, open an issue (tagged ‘enhancement’) to discuss it. We’re much more likely to be able to do it if you can be clear and concise about what you want, and if you have already written some code that you would like to merge. If you are requesting a complicated analysis technique that is not available, then consider bringing one of the authors of the individual code repositories on as a collaborator.