View source: R/normalize_counts.R
normalize_counts | R Documentation |
This is a niche helper function to normalize counts. Some sensors provide raw
counts and gain levels as part of their output. In some cases it is desirable
to compare counts between sensors, e.g., to gauge daylight outside by
comparing UV counts to photopic counts (a high ratio of UV/Pho indicates
outside daylight). Or to gauge daylight inside by comparing IR counts to
photopic counts (a high ratio of IR/Pho with a low ratio of UV/Pho indicates
daylight in the context of LED or fluorescent lighting). The user can provide
their own gain ratiotable, or use a table provided for a sensor in the
gain.ratio.table
dataset from LightLogR
.
normalize_counts(dataset, gain.columns, count.columns, gain.ratio.table)
dataset |
a |
gain.columns |
a |
count.columns |
a |
gain.ratio.table |
a two-column tibble containing |
an extended dataset with new columns containing normalized counts
example.table <-
tibble::tibble(
uvGain = c(4096, 1024, 2),
visGain = c(4096, 4096, 4096),
irGain = c(2,2,2),
uvValue = c(692, 709, 658),
visValue = c(128369, 129657, 128609),
irValue = c(122193, 127113, 124837))
gain.columns = c("uvGain", "visGain", "irGain")
count.columns = c("uvValue", "visValue", "irValue")
example.table |>
normalize_counts(gain.columns, count.columns, gain.ratio.tables$TSL2585)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.