Title: | Laboratory Sieve Test Reporting Functions |
---|---|
Description: | Functions for making particle-size analysis. Sieve tests are widely used to obtain particle-size distribution of powders or granular materials. |
Authors: | Petr Matousu |
Maintainer: | Petr Matousu <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.2.3 |
Built: | 2024-11-01 11:48:43 UTC |
Source: | CRAN |
The function is used to concatenate more sievetest objects together.
## S3 method for class 'std' c(...)
## S3 method for class 'std' c(...)
... |
one or more |
Returns one std
object concatenated of objects supplied in ... containing all the sieve test samples grouped together.
data(lignite) # a and b simulate some new std objects a <- lignite[2] b <- lignite[1] # ab_group <- c(a,b)
data(lignite) # a and b simulate some new std objects a <- lignite[2] b <- lignite[1] # ab_group <- c(a,b)
The function for querying a std
object for description meta data
or creating new description meta data list.
desc.std(Description = NA, Title = NA, Sample = NA, Unit = NA, Date = NA, x = NULL)
desc.std(Description = NA, Title = NA, Sample = NA, Unit = NA, Date = NA, x = NULL)
Description |
Terse description of a sample |
Title |
Title of particular measurement |
Sample |
Name of the sample |
Unit |
To which unit the sample belongs |
Date |
Day when the sample was taken |
x |
An existing |
To be used for creating input for desc
argument in functions
std
and tweak.std
.
Returns a list of 5:
Description |
|
Title |
|
Sample |
|
Unit |
|
Date |
# create the object by hand # sieve test data (std) object my_sample <- std( a=c(500, 200, 90, 0), r=c(1.01, 24, 42.8, 32.190), desc=desc.std(Title="Coal powder, learning std") )
# create the object by hand # sieve test data (std) object my_sample <- std( a=c(500, 200, 90, 0), r=c(1.01, 24, 42.8, 32.190), desc=desc.std(Title="Coal powder, learning std") )
Rosin - Rammler model of particle-size distribution and cumulative undersize and oversize distributions used to obtain approximation of of powders or granular materials originated by grinding.
drr(x, ex, xs) orr(x, ex, xs) urr(x, ex, xs)
drr(x, ex, xs) orr(x, ex, xs) urr(x, ex, xs)
x |
particle size, equivalent particle diameter |
ex |
Rosin - Rammler exponent, measure of the uniformity of grinding |
xs |
finesse of grinding, that width of mesh associated with a remainder
equal to |
Following functions are used, based on Rosin - Rammler mathematical model of particle-size distribution, for approximation of size distribution.
drr
is Rosin - Rammler probability density functionurr
is Rosin - Rammler cumulative distribution function (CDF) representing undersize mass fractionorr
is Rosin - Rammler complementary CDF representing oversize mass fraction ie. relative remainder on the sieve with the mesh size x
Rosin - Rammler model (1933) is the Weibull distribution which was proposed by Weibull in 1939, and Weibull distribution functions are part of R.
So the user can use stats::dweibull(x,shape=ex,scale=xs)
the same way as drr
,
and use Weibull distribution functions provided by stats
package for deeper analysis.
Similarly, stats::pweibull(x,shape=ex,scale=xs)
can be used the same way as urr
orstats::pweibull(x,shape=ex,scale=xs,lower.tail=F)
the same way as orr
.
Both urr
and orr
returns value of distribution function.
Function drr
returns density.
Rinne, H. (2008) The Weibull Distribution: A Handbook, chapter 1.1.2. Taylor & Francis.
Weibull
, plot.std
, summary.std
## The function drr is currently defined as # function (x, ex, xs) # { # (ex/xs) * (x/xs)^(ex - 1) * exp(-(x/xs)^ex) # } ## The function urr is currently defined as # function (x, ex, xs) # { # 1 - exp(-(x/xs)^ex) # } ## The function orr is currently defined as # function (x, ex, xs) # { # exp(-(x/xs)^ex) # } x <- c(1,5,10,50,100) ex <- 1.386 xs <- 178 stats::dweibull(x,shape=ex,scale=xs) drr(x,ex,xs) stats::pweibull(x,shape=ex,scale=xs) urr(x,ex,xs) stats::pweibull(x,shape=ex,scale=xs,lower.tail=FALSE) orr(x,ex,xs)
## The function drr is currently defined as # function (x, ex, xs) # { # (ex/xs) * (x/xs)^(ex - 1) * exp(-(x/xs)^ex) # } ## The function urr is currently defined as # function (x, ex, xs) # { # 1 - exp(-(x/xs)^ex) # } ## The function orr is currently defined as # function (x, ex, xs) # { # exp(-(x/xs)^ex) # } x <- c(1,5,10,50,100) ex <- 1.386 xs <- 178 stats::dweibull(x,shape=ex,scale=xs) drr(x,ex,xs) stats::pweibull(x,shape=ex,scale=xs) urr(x,ex,xs) stats::pweibull(x,shape=ex,scale=xs,lower.tail=FALSE) orr(x,ex,xs)
This is example std
object, which is used in examples and in demo code. It is based on sieve test results of powdered lignite.
data(lignite)
data(lignite)
data(lignite) str(lignite) summary(lignite) plot(lignite)
data(lignite) str(lignite) summary(lignite) plot(lignite)
The function plots graphical presentation of Rosin-Rammler particle size distribution of powder which is common in grinding and comminution.
## S3 method for class 'std' plot(x, type=c("rr","rrdist"), n=30, lgd=T, col=c("#1B9E77", "#D95F02", "#7570B3", "#E7298A", "#66A61E", "#E6AB02", "#A6761D", "#666666"), bx=1, by=5, lgd.x="topleft", ...)
## S3 method for class 'std' plot(x, type=c("rr","rrdist"), n=30, lgd=T, col=c("#1B9E77", "#D95F02", "#7570B3", "#E7298A", "#66A61E", "#E6AB02", "#A6761D", "#666666"), bx=1, by=5, lgd.x="topleft", ...)
x |
an std object representing sieve test data. |
type |
type of plot |
n |
a factor influencing density of ticks marks |
lgd |
whether to show legend |
col |
vector of colors |
bx |
a factor influencing rounding of x values for labels |
by |
a factor influencing rounding of y values for labels |
lgd.x |
legend position |
... |
additional graphical parameters |
Plots an std object to the current device.
# load example data and make plot data(lignite) plot(lignite) plot(lignite,type='rrdist',lwd=2,lgd.x="right")
# load example data and make plot data(lignite) plot(lignite) plot(lignite,type='rrdist',lwd=2,lgd.x="right")
Reads std
data from CSV file and creates std
object.
read.std(file, sep = "\t", dec = ".")
read.std(file, sep = "\t", dec = ".")
file |
file path. |
sep |
field separator used in the file, defaults to "\t". |
dec |
the character used in the file for decimal points, defaults to ".". |
The file
format allows to have more test data within one file.
# Meta data | --- | --- | --- |
D1 names | D1 values | DN names | DN values |
# Data | --- | --- | --- |
aperture | retained | aperture | retained |
A1 | R1 values | An | Rn values |
Section D1 or DN is 5 rows of meta data.
Commented lines must not be removed.
Multi row columns A and R corresponds to a
and r
arguments of
std
function, D corresponds to desc
.
The file must have at least two columns, then it is just for 1 sample data, or it can have Nx2 columns for N samples.
Data section allows for different number of A1 and AN rows.
Returns a std
object.
# provided example file fi <- system.file("lignite.csv",package="sievetest") # inspect the file file.show(fi) # read the file # there will be warning, because the file is prepared the way # to show them, they are OK a <- read.std(fi) plot(a)
# provided example file fi <- system.file("lignite.csv",package="sievetest") # inspect the file file.show(fi) # read the file # there will be warning, because the file is prepared the way # to show them, they are OK a <- read.std(fi) plot(a)
Function transform user coordinates of plot to axis coordinates or vise versa.
rrx2x(x) rry2y(x) x2rrx(x) y2rry(x)
rrx2x(x) rry2y(x) x2rrx(x) y2rry(x)
x |
Value to transform. |
The default plot type "rr" uses transformed coordinates, so the user can
read percents on y axis and micrometers on x axis, while par('usr')
returns coordinates in log(x)
and log(log(100/y))
.
Hence the user can use transformation functions to convert between the types.
The "rr" keyword in the name of function, belongs to the log x log-log (usr) space.
Functions return appropriate transformed value.
data(lignite) plot(lignite) # query for exact x coordinates within the plot if(interactive()) rrx2x(locator()$x) # query for exact y coordinates within the plot if(interactive()) rry2y(locator()$y) # or y2rry(36.78794) # or rrx2x(par('usr')[1])
data(lignite) plot(lignite) # query for exact x coordinates within the plot if(interactive()) rrx2x(locator()$x) # query for exact y coordinates within the plot if(interactive()) rry2y(locator()$y) # or y2rry(36.78794) # or rrx2x(par('usr')[1])
Functions to create, test and subset a std
object.
std(a, r, desc = desc.std(), lmargs = list()) is.std(x) ## S3 method for class 'std' x[i, ...]
std(a, r, desc = desc.std(), lmargs = list()) is.std(x) ## S3 method for class 'std' x[i, ...]
a |
A vector of sieve net aperture sizes in micrometers, zero size means the receiver. |
i |
An integer or vector of integers |
r |
Mass percent of remaining material on the sieve, vector with the same length as vector |
desc |
A description meta data prepared by |
lmargs |
A list of additional arguments to |
x |
An object of |
... |
Not used |
Basically the std
object is list of lists, in the first level (trunk) are stored particular sieve test samples, in the second level (branches) are stored details of each single sample. If there is only one sample in the std
object, then the length will be 1.
The object can be created by hand using std
function or by reading the basic information from CSV file using read.std
function.
Once the std
object exists, it can be sub-selected using x[i]
or concatenated by c(...)
.
Both std(a,r)
and x[i]
functions return std
object, x[[i]]
returns list holding following informations:
Description |
Terse description of a sample |
Title |
Title of particular measurement |
Sample |
Name of the sample |
Unit |
To which unit the sample belongs |
Date |
Day when the sample was taken |
stdata |
Data frame with given and calculated values |
lmfit |
Result of linear model fit, |
RRcoefficients |
List of coefficients for Rosin - Rammler distribution |
size |
List of characteristic sizes of Rosin - Rammler distribution |
The is.std(x) function returns logical value.
read.std
, c.std
, summary.std
, tweak.std
## create std sieve_aperture_size <- c(500, 200, 90, 0) mass_ppc_retained <- c(1.01, 24, 42.8, 32.190) # some meta data: md <- desc.std("Coal powder, learning std") # sieve test data (std) object my_sample <- std(a=sieve_aperture_size, r=mass_ppc_retained, desc=md) is.std(my_sample)
## create std sieve_aperture_size <- c(500, 200, 90, 0) mass_ppc_retained <- c(1.01, 24, 42.8, 32.190) # some meta data: md <- desc.std("Coal powder, learning std") # sieve test data (std) object my_sample <- std(a=sieve_aperture_size, r=mass_ppc_retained, desc=md) is.std(my_sample)
The function makes summary table of std
object.
## S3 method for class 'std' summary(object, ...)
## S3 method for class 'std' summary(object, ...)
object |
|
... |
not used |
Returns data frame with following columns:
Description |
Terse description of a sample |
Title |
Title of particular measurement |
Sample |
Name of the sample |
Unit |
To which unit the sample belongs |
Date |
Day when the sample was taken |
RRxs |
Rosin - Rammler distribution xs coefficient |
RRex |
Rosin - Rammler distribution ex coefficient |
RRms |
modus calculated from Rosin - Rammler approximation |
RRmn |
mean calculated from Rosin - Rammler approximation |
RRo90umPPC |
CCDF (oversize) value in % calculated from Rosin - Rammler approximation for equivalent particle size of 90 micrometers |
data(lignite) summary(lignite)
data(lignite) summary(lignite)
The function is used for modifying of existing std
object.
tweak.std( x, desc = desc.std(x = x), lmargs = as.list(x[[1]]$lmfit$call[-c(1:3)]))
tweak.std( x, desc = desc.std(x = x), lmargs = as.list(x[[1]]$lmfit$call[-c(1:3)]))
x |
|
desc |
list of description meta data, default is original meta data of object |
lmargs |
list of |
The function modifies the std
object or just refresh the x
object while recalculating the lm
fit, Rosin - Rammler coefficients and characteristic sizes. The refreshing of an old saved object can be useful in case that lm
fit structure changes across R versions as the std
object encapsulates lm
fit result.
Returns std
object with length = 1.
# Load the data, modify linear model and plot. data(lignite) std1 <- lignite[2] std2 <- tweak.std(lignite[2],lmargs = list(weights=c(1,1,0,1)), desc = desc.std(x=std1,Title="Lignite w 1 1 0 1")) plot(c(std1,std2))
# Load the data, modify linear model and plot. data(lignite) std1 <- lignite[2] std2 <- tweak.std(lignite[2],lmargs = list(weights=c(1,1,0,1)), desc = desc.std(x=std1,Title="Lignite w 1 1 0 1")) plot(c(std1,std2))