Skip to contents

Introduction

ConSciR is an R package specifically designed to assist conservators, scientists and engineers by providing a toolkit for performing calculations and streamlining common tasks in cultural heritage conservation.

Install and load

install.packages("pak")
pak::pak("BhavShah01/ConSciR")

-or-

# install.packages("devtools")
devtools::install_github("BhavShah01/ConSciR")

The ConSciR Github page: ConSciR Github

Examples

Add calculated values using mutate

# Add calculated values using mutate
head(mydata) |> 
  mutate(
    Absolute_Humidity = calcAH(Temp, RH), 
    Dew_Point = calcDP(Temp, RH), 
    Mixing_Ratio = calcMR(Temp, RH), 
    Humidity_Ratio = calcHR(Temp, RH),
    Enthalpy = calcEnthalpy(Temp, RH), 
    Saturation_Vapour_Pressure = calcPws(Temp), 
    Actual_Vapour_Pressure = calcPw(Temp, RH), 
    Air_Density = calcAD(Temp, RH),
    Temp_calc = calcTemp(RH, Dew_Point),
    RH_AH_calc = calcRH_AH(Temp, Absolute_Humidity),
    RH_DP_calc = calcRH_DP(Temp, Dew_Point)
  ) |>
  glimpse()
#> Rows: 6
#> Columns: 16
#> $ Site                       <chr> "London", "London", "London", "London", "Lo…
#> $ Sensor                     <chr> "Room 1", "Room 1", "Room 1", "Room 1", "Ro…
#> $ Date                       <dttm> 2024-01-01 00:00:00, 2024-01-01 00:15:00, …
#> $ Temp                       <dbl> 21.8, 21.8, 21.8, 21.7, 21.7, 21.7
#> $ RH                         <dbl> 36.8, 36.7, 36.6, 36.6, 36.5, 36.2
#> $ Absolute_Humidity          <dbl> 7.052415, 7.033251, 7.014087, 6.973723, 6.9…
#> $ Dew_Point                  <dbl> 6.383970, 6.344456, 6.304848, 6.216205, 6.1…
#> $ Mixing_Ratio               <dbl> 5.959586, 5.943237, 5.926888, 5.890432, 5.8…
#> $ Humidity_Ratio             <dbl> 0.8563133, 0.8559750, 0.8556350, 0.8548712,…
#> $ Enthalpy                   <dbl> 37.16251, 37.12097, 37.07942, 36.88466, 36.…
#> $ Saturation_Vapour_Pressure <dbl> 26.13122, 26.13122, 26.13122, 25.97199, 25.…
#> $ Actual_Vapour_Pressure     <dbl> 9.616288, 9.590156, 9.564025, 9.505748, 9.4…
#> $ Air_Density                <dbl> 1.196694, 1.196694, 1.196694, 1.197100, 1.1…
#> $ Temp_calc                  <dbl> 21.8, 21.8, 21.8, 21.7, 21.7, 21.7
#> $ RH_AH_calc                 <dbl> 36.8, 36.7, 36.6, 36.6, 36.5, 36.2
#> $ RH_DP_calc                 <dbl> 36.8, 36.7, 36.6, 36.6, 36.5, 36.2

Perform calculations to visualise and explore data


mydata |>
  # Calculate Absolute Humidity and Dew Point
  mutate(
    AbsHum = calcAH(Temp, RH),
    DewPoint = calcDP(Temp, RH)
  ) |>
  # Create base plot using graph_TRH function
  graph_TRH() +
  # Add Absolute Humidity line
  geom_line(aes(Date, AbsHum), color = "green") +
  # Add Dew Point line
  geom_line(aes(Date, DewPoint), color = "purple") +
  # Apply a theme
  theme_bw()

visualisations

Built in psychrometric chart


head(mydata, 100) |>
  graph_psychrometric() + 
  theme_bw()

psychrometric_chart_example