discretized {opm}R Documentation

Get discretised data

Description

Get the discretised kinetic data or the discretisation settings used. (See do_disc for generating discretised data.)

Usage

  ## S4 method for signature 'MOPMX'
disc_settings(object, join = NULL) 
  ## S4 method for signature 'NULL'
disc_settings(object, ...) 
  ## S4 method for signature 'OPMD'
disc_settings(object, join = NULL) 
  ## S4 method for signature 'OPMS'
disc_settings(object, join = NULL) 
  ## S4 method for signature 'character'
disc_settings(object, ...) 
  ## S4 method for signature 'logical'
disc_settings(object, ...) 
  ## S4 method for signature 'numeric'
disc_settings(object, ...) 

  ## S4 method for signature 'MOPMX'
discretized(object, ...) 
  ## S4 method for signature 'OPMD'
discretized(object, full = FALSE,
    in.parens = TRUE, max = opm_opt("max.chars"), ...) 
  ## S4 method for signature 'OPMS'
discretized(object, ...) 

Arguments

object

OPMD, OPMS or MOPMX object. disc_settings methods for other classes are helpers for generating raw settings lists.

full

Logical scalar passed to wells. This and the following arguments affect the names of the resulting vector.

in.parens

Logical scalar also passed to that function.

max

Numeric scalar also passed to that function.

join

Empty or character scalar. Works like the eponymous argument of aggr_settings; see there for details.

...

Optional arguments passed between the methods or to wells.

Value

Logical vector or matrix in the case of discretized, named list in the case of disc_settings. See the examples for details.

See Also

Other getter-functions: aggr_settings, aggregated, anyDuplicated, anyNA, contains, csv_data, dim, duplicated, has_aggr, has_disc, hours, max, measurements, minmax, seq, subset, thin_out, well

Examples

# 'OPM' methods
(x <- discretized(vaas_1))[1:3] # => logical vector
##   A01   A02   A03 
## FALSE  TRUE  TRUE
stopifnot(is.logical(x), !is.matrix(x), length(x) == dim(x)[2L])
stopifnot(names(x) == colnames(aggregated(vaas_1)))
(x <- discretized(vaas_1, full = TRUE))[1:3] # => with full names
## A01 (Negative Control)          A02 (Dextrin)        A03 (D-Maltose) 
##                  FALSE                   TRUE                   TRUE
stopifnot(names(x) == colnames(aggregated(vaas_1, full = TRUE)))

# settings
(x <- disc_settings(vaas_1)) # => named list
## $method
## [1] "kmeans"
## 
## $options
## $options$cutoffs
## [1] 129.0670 241.2105
## 
## $options$datasets
## [1] 1
## 
## $options$parameter
## [1] "A"
## 
## 
## $software
## [1] "opm"
## 
## $version
## [1] "0.7-0"
stopifnot(is.list(x), !is.null(names(x)))
(x <- disc_settings(vaas_1, join = "yaml")) # matrix, one row per plate
##      method  
## [1,] "kmeans"
##      options                                                                
## [1,] "---\ncutoffs:\n- 129.06705\n- 241.2105\ndatasets: 1\nparameter: A\n\n"
##      software version
## [1,] "opm"    "0.7-0"
stopifnot(is.matrix(x), is.character(x), nrow(x) == 1)

# 'OPMS' methods
(x <- discretized(vaas_4))[, 1:3] # => logical matrix
##        A01   A02   A03
## [1,] FALSE    NA FALSE
## [2,]    NA  TRUE  TRUE
## [3,] FALSE FALSE FALSE
## [4,] FALSE FALSE FALSE
stopifnot(is.logical(x), is.matrix(x), ncol(x) == dim(x)[2L])
stopifnot(colnames(x) == colnames(aggregated(vaas_1)))

# settings
summary(x <- disc_settings(vaas_4)) # => list of named lists, one per plate
##      Length Class  Mode
## [1,] 4      -none- list
## [2,] 4      -none- list
## [3,] 4      -none- list
## [4,] 4      -none- list
stopifnot(is.list(x), is.null(names(x)), length(x) == length(vaas_4))
stopifnot(duplicated(x)[-1])
(x <- disc_settings(vaas_4, join = "json")) # matrix, one row per plate
##      method  
## [1,] "kmeans"
## [2,] "kmeans"
## [3,] "kmeans"
## [4,] "kmeans"
##      options                                                                             
## [1,] "{\"cutoffs\":[111.8537965869,230.912480834744],\"datasets\":4,\"parameter\":\"A\"}"
## [2,] "{\"cutoffs\":[111.8537965869,230.912480834744],\"datasets\":4,\"parameter\":\"A\"}"
## [3,] "{\"cutoffs\":[111.8537965869,230.912480834744],\"datasets\":4,\"parameter\":\"A\"}"
## [4,] "{\"cutoffs\":[111.8537965869,230.912480834744],\"datasets\":4,\"parameter\":\"A\"}"
##      software version
## [1,] "opm"    "0.7-0"
## [2,] "opm"    "0.7-0"
## [3,] "opm"    "0.7-0"
## [4,] "opm"    "0.7-0"
stopifnot(is.matrix(x), is.character(x), nrow(x) == 4)

[Package opm version 1.3.63 Index]