Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Normalization (#7) #8

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export(compress_low_energy)
export(get_plot_sample_ids)
export(ir_to_plotftir)
export(move_plot_legend)
export(normalize_spectra)
export(plot_ftir)
export(plot_ftir_stacked)
export(plotftir_to_chemospec)
Expand Down
250 changes: 187 additions & 63 deletions R/maths.R

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ biodiesel_transm <- absorbance_to_transmittance(biodiesel)
head(biodiesel_transm)
```

Functions are provided for adjusting the baseline of spectra, adding or subtracting scalar values from entire spectra, and averaging spectra, see:
Functions are provided for adjusting the baseline of spectra, adding or subtracting scalar values from entire spectra, normalizing spectra, and averaging spectra, see:
* `recalculate_baseline()`
* `add_scalar_value()` and `subtract_scalar_value()`
* `normalize_spectra()`
* `average_spectra()`

## Reading Files
Expand Down Expand Up @@ -313,9 +314,10 @@ biodiesel_transm <- absorbance_to_transmittance(biodiesel)
head(biodiesel_transm)
```

Des fonctions sont fournies pour ajuster la ligne de base des spectres, ajouter ou soustraire des valeurs scalaires de spectres entiers, et calculer la moyenne des spectres, voir :
Des fonctions sont fournies pour ajuster la ligne de base des spectres, ajouter ou soustraire des valeurs scalaires de spectres entiers, normalisation des spectres, et calculer la moyenne des spectres, voir :
* `recalculate_baseline()`
* `add_scalar_value()` et `subtract_scalar_value()`
* `normalize_spectra()`
* `average_spectra()`

## Lecture des fichiers
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
[![R-CMD-check](https://github.com/NRCan/PlotFTIR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/NRCan/PlotFTIR/actions/workflows/R-CMD-check.yaml)
[![Lifecycle:
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![Coveralls test coverage](https://coveralls.io/repos/github/NRCan/PlotFTIR/badge.svg)](https://coveralls.io/r/NRCan/PlotFTIR?branch=main)
[![Coveralls test
coverage](https://coveralls.io/repos/github/NRCan/PlotFTIR/badge.svg)](https://coveralls.io/r/NRCan/PlotFTIR?branch=main)
<!-- badges: end -->

## Introduction and Installation
Expand Down Expand Up @@ -204,9 +205,10 @@ head(biodiesel_transm)
```

Functions are provided for adjusting the baseline of spectra, adding or
subtracting scalar values from entire spectra, and averaging spectra,
see: \* `recalculate_baseline()` \* `add_scalar_value()` and
`subtract_scalar_value()` \* `average_spectra()`
subtracting scalar values from entire spectra, normalizing spectra, and
averaging spectra, see: \* `recalculate_baseline()` \*
`add_scalar_value()` and `subtract_scalar_value()` \*
`normalize_spectra()` \* `average_spectra()`

## Reading Files

Expand Down Expand Up @@ -454,9 +456,11 @@ head(biodiesel_transm)
```

Des fonctions sont fournies pour ajuster la ligne de base des spectres,
ajouter ou soustraire des valeurs scalaires de spectres entiers, et
calculer la moyenne des spectres, voir : \* `recalculate_baseline()` \*
`add_scalar_value()` et `subtract_scalar_value()` \* `average_spectra()`
ajouter ou soustraire des valeurs scalaires de spectres entiers,
normalisation des spectres, et calculer la moyenne des spectres, voir :
\* `recalculate_baseline()` \* `add_scalar_value()` et
`subtract_scalar_value()` \* `normalize_spectra()` \*
`average_spectra()`

## Lecture des fichiers

Expand Down
1 change: 1 addition & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
* Changes to working directory were unavoidable by the interface to ChemoSpec (that package doesn't allow
for specifying directory when importing files). As such, in-code changes to working directory are protected
with a call to `on.exit()`.
* This resubmit also adds a function for normalization of spectra per user request (in maths.R), with associated docs.
24 changes: 15 additions & 9 deletions man/add_subtract_scalar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 17 additions & 11 deletions man/average_spectra.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions man/normalize_spectra.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plotftir_to_ir.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/read_ftir.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions man/read_ftir_directory.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading