Skip to content

Commit 2772a89

Browse files
20250706 - adjust sourdough fermentation and proofing times
1 parent 46022f6 commit 2772a89

8 files changed

Lines changed: 119 additions & 5 deletions

File tree

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ keywords:
3030
- R-package
3131
- psychometrics
3232
license: MIT
33-
version: 1.1.6
33+
version: 1.1.7
3434
date-released: '2025-02-02'

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: petersenlab
22
Type: Package
33
Title: A Collection of R Functions by the Petersen Lab
4-
Version: 1.1.6
4+
Version: 1.1.7
55
Authors@R: c(
66
person("Isaac T.", "Petersen",
77
email = "isaac-t-petersen@uiowa.edu",

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export(accuracyAtCutoff)
77
export(accuracyAtEachCutoff)
88
export(accuracyOverall)
99
export(addText)
10+
export(adjust_sourdough_time)
1011
export(apa)
1112
export(attenuationCorrelation)
1213
export(cleanUpNames)

R/sourdoughRecipeTimes.R

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#' @title
2+
#' Adjust Sourdough Recipe Fermentation and Proofing Times Based on Temperature
3+
#'
4+
#' @description
5+
#' Adjust sourdough recipe fermentation and proofing times based on temperature.
6+
#'
7+
#' @details
8+
#' Adjusts sourdough recipe fermentation and proofing times based on ambient
9+
#' temperature. Suggested times are calculated using the \eqn{Q_{10}}
10+
#' temperature coefficient, which describes how the rate of fermentation changes
11+
#' with a 10°C temperature difference.
12+
#'
13+
#' @param original_time The original time(s) specified in the original recipe.
14+
#' @param recipe_temp The intended ambient temperature in the original recipe.
15+
#' @param actual_temp The actual ambient temperature used.
16+
#' @param q10 The \eqn{Q_{10}} temperature coefficient (describes rate change
17+
#' per 10°C).
18+
#' @param temp_unit "F" for Fahrenheit; "C" for Celsius.
19+
#'
20+
#' @return The adjusted sourdough fermentation or proofing time(s).
21+
#'
22+
#' @family baking
23+
#'
24+
#' @export
25+
#'
26+
#' @examples
27+
#' adjust_sourdough_time(
28+
#' original_time = c(12, 15, 18),
29+
#' recipe_temp = 70,
30+
#' actual_temp = 75
31+
#' )
32+
#'
33+
#' @seealso
34+
#' \url{https://en.wikipedia.org/wiki/Q10_(temperature_coefficient)}
35+
36+
adjust_sourdough_time <- function(
37+
original_time,
38+
recipe_temp,
39+
actual_temp,
40+
q10 = 2,
41+
temp_unit = c("F","C")) {
42+
43+
# Match argument for temperature unit
44+
temp_unit <- match.arg(temp_unit)
45+
46+
# Convert to Celsius if input is in Fahrenheit
47+
if (temp_unit == "F") {
48+
recipe_temp <- (recipe_temp - 32) * 5 / 9
49+
actual_temp <- (actual_temp - 32) * 5 / 9
50+
}
51+
52+
# Calculate the adjustment factor
53+
adjustment_factor <- q10 ^ ((recipe_temp - actual_temp) / 10)
54+
55+
# Return the new time
56+
new_time <- original_time * adjustment_factor
57+
58+
return(new_time)
59+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ A list of the functions included in the package is here: https://devpsylab.githu
3737

3838
To obtain the citation for the `petersenlab` package, run `citation("petersenlab")`; the citation is:
3939

40-
Petersen, I. T. (2025). *petersenlab: A collection of R functions by the Petersen Lab*. R package version 1.1.6. https://github.com/DevPsyLab/petersenlab, https://doi.org/10.32614/CRAN.package.petersenlab
40+
Petersen, I. T. (2025). *petersenlab: A collection of R functions by the Petersen Lab*. R package version 1.1.7. https://github.com/DevPsyLab/petersenlab, https://doi.org/10.32614/CRAN.package.petersenlab
4141

4242
A `BibTeX` entry for `LaTeX` users is:
4343
```
@@ -46,7 +46,7 @@ A `BibTeX` entry for `LaTeX` users is:
4646
title = {{petersenlab}: A collection of {R} functions by the {Petersen Lab}},
4747
url = {https://github.com/DevPsyLab/petersenlab},
4848
doi = {10.32614/CRAN.package.petersenlab},
49-
version = {1.1.6},
49+
version = {1.1.7},
5050
year = {2025}
5151
}
5252
```

_pkgdown.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ reference:
168168

169169
- title: Miscellaneous
170170

171+
- subtitle: Baking
172+
contents:
173+
- adjust_sourdough_time
174+
171175
- subtitle: Fantasy Football
172176
contents:
173177
- cleanUpNames

inst/CITATION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ bibentry(
77
comment = c(ORCID = "0000-0003-3072-6673"))),
88
year = 2025,
99
doi = "10.32614/CRAN.package.petersenlab",
10-
note = "R package version 1.1.6, https://devpsylab.github.io/petersenlab/",
10+
note = "R package version 1.1.7, https://devpsylab.github.io/petersenlab/",
1111
url = "https://github.com/DevPsyLab/petersenlab",
1212
key = "petersenlab"
1313
)

man/adjust_sourdough_time.Rd

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)