https://github.com/bhavshah01/conscir
Tools for Conservation Science
https://github.com/bhavshah01/conscir
conservation-science heritage heritage-conservation heritage-science humidity r rpackage sustainability
Last synced: 8 months ago
JSON representation
Tools for Conservation Science
- Host: GitHub
- URL: https://github.com/bhavshah01/conscir
- Owner: BhavShah01
- License: gpl-3.0
- Created: 2024-12-11T01:44:46.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-09-22T15:54:28.000Z (9 months ago)
- Last Synced: 2025-10-22T04:59:46.822Z (8 months ago)
- Topics: conservation-science, heritage, heritage-conservation, heritage-science, humidity, r, rpackage, sustainability
- Language: R
- Homepage: https://bhavshah01.github.io/ConSciR/
- Size: 43.4 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
warning = FALSE,
message = FALSE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
`ConSciR` provides tools for the analysis of cultural heritage preventive conservation data.
It includes functions for environmental data analysis, humidity calculations, sustainability metrics, conservation risks, and data visualisations such as psychrometric charts. It is designed to support conservators, scientists, and engineers by streamlining common calculations and tasks encountered in heritage conservation workflows. The package is motivated by the framework outlined in Cosaert and Beltran et al. (2022) "Tools for the Analysis of Collection Environments" ["Tools for the Analysis of Collection Environments"](https://www.getty.edu/conservation/publications_resources/pdf_publications/tools_for_the_analysis_of_collection_environments.html "Getty Tools publication").
`ConSciR` is intended for:\
- Conservators working in museums, galleries, and heritage sites\
- Conservation scientists, engineers, and researchers\
- Data scientists developing applications for conservation\
- Cultural heritage professionals involved in preventive conservation\
- Students and educators in conservation and heritage science programmes
The package is also designed to be:\
- **FAIR**: Findable, Accessible, Interoperable, and Reusable\
- **Collaborative**: enabling contributions, feature requests, bug reports, and
additions from the wider community
If using R for the first time, read an article here: [Using R for the first time](https://bhavshah01.github.io/ConSciR/articles/ConSciR-FirstTimeR.html)
## Tools
- Humidity calculations, conservator tools, and sustainability metrics.
- Mould growth models and damage risk functions.
- Graphical outputs including temperature-relative humidity (TRH) plots, psychrometric charts and data for other applications.
- Data tidying functions compatible with Meaco and Hanwell environmental monitoring devices.
- Interactive Shiny applications enabling dynamic data exploration and visualisation.
## Install and load
``` r
install.packages("ConSciR")
library(ConSciR)
```
You can install the development version of the package from GitHub using the `pak` package:
``` r
install.packages("pak")
pak::pak("BhavShah01/ConSciR")
# Alternatively
# install.packages("devtools")
# devtools::install_github("BhavShah01/ConSciR")
```
For full details on all functions, see the package [Reference](https://bhavshah01.github.io/ConSciR/reference/index.html) manual.
## Examples
This section demonstrates some common tasks you can perform with the ConSciR package.
- **Load packages**\
Load ConSciR and some commonly used tidyverse packages for data manipulation and plotting.
```{r packages, message=FALSE, warning=FALSE}
library(ConSciR)
library(dplyr)
library(ggplot2)
```
- **Access an example dataset**\
A pre-loaded dataset (`mydata`) is included for testing and demonstration. Use `head()` to view the first few rows and inspect the data structure.
- Users can rename columns and structure their own datasets similarly to `mydata` to ensure compatibility with ConSciR functions, which expect variables such as temperature and relative humidity in specific column names.
```{r load_dataset, message=FALSE, warning=FALSE}
# My TRH data
filepath <- data_file_path("mydata.xlsx")
mydata <- readxl::read_excel(filepath, sheet = "mydata")
mydata <- mydata |> filter(Sensor == "Room 1")
head(mydata)
```
- **Perform calculations on the data**\
Use ConSciR functions to add metrics such as dew point, absolute humidity, mould, preservation index and others to the dataset. More functions are available; see the package [Reference](https://bhavshah01.github.io/ConSciR/reference/index.html) for details.
```{r add_calcs, message=FALSE, warning=FALSE}
# Peform calculations
head(mydata) |>
mutate(
# Dew point
DewP = calcDP(Temp, RH),
# Absolute humidity
Abs = calcAH(Temp, RH),
# Mould risk
Mould = ifelse(RH > calcMould_Zeng(Temp, RH), "Mould risk", "No mould"),
# Preservation Index, years to deterioration
PI = calcPI(Temp, RH),
# Scenario: Humidity if the temperature was 2°C higher
RH_if_2C_higher = calcRH_AH(Temp + 2, Abs)
) |>
glimpse()
```
- **Combine analysis with visualisation**\
Add a dew point line to the temperature-relative humidity graph using the package’s built-in plotting function **`graph_TRH()`**.
```{r graphTRH_DewPoint, message=FALSE, warning=FALSE, fig.alt="graphTRH"}
mydata |>
mutate(DewPoint = calcDP(Temp, RH)) |>
graph_TRH() +
geom_line(aes(Date, DewPoint), col = "cyan3") + # add dew point
theme_bw()
```
- **Conservator tools: mould growth estimation**\
Calculate mould growth risk using **`calcMould_Zeng()`** function and visualise it alongside humidity data.
```{r mould_risk, message=FALSE, warning=FALSE, fig.alt="mould"}
mydata |>
mutate(Mould = calcMould_Zeng(Temp, RH)) |>
ggplot() +
geom_line(aes(Date, RH), col = "royalblue3") +
geom_line(aes(Date, Mould), col = "darkorchid", size = 1) +
labs(title = "Mould Growth Rate Limits",
subtitle = "Mould growth initiates when RH goes above threshold",
x = NULL, y = "Humidity (%)") +
facet_grid(~Sensor) +
theme_classic(base_size = 14)
```
- **Graphs: generate a psychrometric chart**\
Visualise the data using a psychrometric chart with the function `graph_psychrometric()`. The example shows how a basic plot can be customised; data transparency, temperature and humidity ranges, and the y-axis function.
```{r psychart, message=FALSE, warning=FALSE, fig.alt="psych_chart"}
# Customise
mydata |>
graph_psychrometric(
data_alpha = 0.2,
LowT = 8,
HighT = 28,
LowRH = 30,
HighRH = 70,
y_func = calcAH
) +
theme_classic() +
labs(title = "Psychrometric chart")
```
