Learn R Programming

BayesianFROC (version 1.0.0)

from_array_to_vector: Transform from an array to a vector

Description

Transform a vector into an array

Usage

from_array_to_vector(Three.dim.array)

Arguments

Three.dim.array

Three dimensional array, such as the number of hits for each confidence level, modality and reader. Or false alarms. Since the author construct the substituting data list as one dimensional (one index) array, it needs to reconstruct to the three indexed array from one dimensional array whose subscript is [confidence level, modality, reader ] or vice versa.

Value

A vector, transformed from three dimensional array.

Details

In stan files of this package, the number of hits, false alarms and hit rates in binomial assumption for MRMC case are written with the three indexed array format. Three index indicates confidence levels, modality ID, reader ID. However, hit data passed to the function BayesianFROC::fit_Bayesian_FROC() are written with the vector. So, in order to connect these different format, (i.e. vector and array, ) the author made this function.

Examples

Run this code
# NOT RUN {
#========================================================================================
#               Practical example
#========================================================================================

  h.array.etc <- hits_from_thresholds()
  h.array.etc$h
  h.vector     <- from_array_to_vector(h.array.etc$h)
  h.vector


#========================================================================================
#               Educational example 1
#========================================================================================


  a <- array_easy_example()
  a
  a.vector <- from_array_to_vector(a)
  a.vector

#========================================================================================
#               Educational example 2
#========================================================================================

  a <- array_easy_example(2,3,2)
  a
  a.vector <- from_array_to_vector(a)
  a.vector

                           # Revised 2019 August 20
                           # Revised 2020 Jan

  
# }

Run the code above in your browser using DataLab