| Title: | Resolving starch granule distributions |
|---|---|
| Description: | Work out distributions. |
| Authors: | Alex Whan [aut, cre], Emi Tanaka [aut] |
| Maintainer: | Alex Whan <[email protected]> |
| License: | GPL-3 | file LICENSE |
| Version: | 0.4.2 |
| Built: | 2026-07-05 08:34:23 UTC |
| Source: | https://github.com/csiro-crop-informatics/granular |
A function to test how well the fit matches the data
check_fit(fit_output, dist, ps)check_fit(fit_output, dist, ps)
fit_output |
A data frame output from mix_dist() |
dist |
A numeric vector defining the distribution |
ps |
A numeric vector describing the granule sizes |
a ggplot object
A dataset containing the distributions from three samples
DistDist
A data frame with 100 rows and 4 variables:
Size of granule, in um
Distribution of sample
Distribution of sample
Distribution of sample
Get the heights at peaks
get_heights(dist, ps, means)get_heights(dist, ps, means)
dist |
A numeric vector defining the distribution |
ps |
A numeric vector describing the granule sizes |
means |
A named numeric vector defining the means (center) for each peak |
A named vector with heights for each mean
A function for plotting a fit output against the true distribution
ggfit(fit_output, dist, ps, title = NULL)ggfit(fit_output, dist, ps, title = NULL)
fit_output |
A data frame output from mix_dist() |
dist |
A numeric vector defining the distribution |
ps |
A numeric vector describing the granule sizes |
title |
Logical. Should a title be added to the plot? |
a ggplot object
Generate fit plots for a grouped tbl
ggfit_grp_tbl(.data, fit_output, proportion, size)ggfit_grp_tbl(.data, fit_output, proportion, size)
.data |
A tbl output from mix_grp_tbl, with list columns |
fit_output |
Variable name holding mix_dist_output |
proportion |
Variable name holding distribution as a list |
size |
Variable name holding particle size as a list |
The original tbl with a list column of ggplot output
Make a mixture distribution
make_dist(fit_output, ps)make_dist(fit_output, ps)
fit_output |
A data frame output from mix_dist() |
ps |
A numeric vector describing the granule sizes |
A numeric vector describing the mixture distribution
use mix() to estimate underlying distributions
mix_dist(dist, ps, mu_vec, pi_vec = NULL, sigma_vec = NULL, peak_names = NULL, sample_name = NULL, emnum = 10, log_trans = TRUE)mix_dist(dist, ps, mu_vec, pi_vec = NULL, sigma_vec = NULL, peak_names = NULL, sample_name = NULL, emnum = 10, log_trans = TRUE)
dist |
A numeric vector defining the distribution |
ps |
A numeric vector describing the granule sizes |
mu_vec |
A vector defining distribution means (required) |
pi_vec |
A vector defining distribution proportions (optional) |
sigma_vec |
A vector defining distribution dispersion (optional) |
peak_names |
A vector defining peak names (optional) |
sample_name |
A character string defining the sample name (optional) |
emnum |
passed to mix() - A non-negative integer specifying the number of EM steps to be performed |
log_trans |
Logical. Should values be log-transformed? |
A list with the fit parameters for each distribution, and complete output from mixdist::mix()
Title
mix_grp_tbl(.data, proportion, size, mu_vec, pi_vec = NULL, sigma_vec = NULL, peak_names = NULL, emnum = 10, log_trans = TRUE, parallel = FALSE)mix_grp_tbl(.data, proportion, size, mu_vec, pi_vec = NULL, sigma_vec = NULL, peak_names = NULL, emnum = 10, log_trans = TRUE, parallel = FALSE)
.data |
A tbl grouped by each distribution |
proportion |
An unquoted variable name |
size |
An unquoted variable name |
mu_vec |
A vector defining distribution means (required) |
pi_vec |
A vector defining distribution proportions (optional) |
sigma_vec |
A vector defining distribution dispersion (optional) |
peak_names |
A vector defining peak names (optional) |
emnum |
passed to mix() - A non-negative integer specifying the number of EM steps to be performed |
log_trans |
Logical. Should values be log-transformed? |
parallel |
Logical. Should multidplyr be used to run in parallel? (EXPERIMENTAL) |
A mutated tbl with list column output
A dataset containing the output from 118 - Average
ms1ms1
A data frame with 3 rows and 8 variables:
Name of the sample
Peak name
Distribution proportion
Distribution mean
Distribution sd
proportion standard error
mean standard error
sd standard error
A dataset containing the output from 85 - Average
ms2ms2
A data frame with 3 rows and 8 variables:
Name of the sample
Peak name
Distribution proportion
Distribution mean
Distribution sd
proportion standard error
mean standard error
sd standard error
A dataset containing the output from 206 - Average
ms3ms3
A data frame with 3 rows and 8 variables:
Name of the sample
Peak name
Distribution proportion
Distribution mean
Distribution sd
proportion standard error
mean standard error
sd standard error
Run the granular shiny app locally
run_granular(port = NULL, launch.browser = TRUE, host = getOption("shiny.host", "127.0.0.1"))run_granular(port = NULL, launch.browser = TRUE, host = getOption("shiny.host", "127.0.0.1"))
port |
The TCP port that the application should listen on. Defaults to choosing a random port. |
launch.browser |
If true, the system's default web browser will be launched automatically after the app is started. defaults to true in interactive sessions only. |
host |
The IPv4 address that the application should listen on. Defaults
to the |