Learn R Programming

fitteR (version 0.2.0)

printReport: Prepare report of fitting

Description

Prepares a summary of the fitting as csv or shiny

Usage

printReport(x, file = NULL, type = "csv")

Arguments

x

The output of fitter

file

A character string giving the filename (including path) where the report should be printed

type

A character vector giving the desired type(s) of output

Value

A list with items

table

A data.frame with the same formating as the resulting csv file.

shiny

if "shiny" %in% type: a shiny object

Details

The routine generates a simple csv file, which is the most useful output in terms of reusability. However, the shiny output is more powerful and provides an overview of the statistics and a figure for visual/manual exploration of the fits. Irrspective of output type being “csv” or “shiny”, the fit-table has the following format

package

package name

distr

name of the distribution

nargs

number of parameters

args

names of parameters, comma-seperated list

estimate

estimated values of parameters, comma-seperated list

start

start values of parameters, comma-seperated list

constraints

were constraints used, logical

runtime

the runtime in milliseconds

KS

test statistic $D$ of a two-sided, two-sample Kolmogorov-Smirnov test

pKS

$P$-value of a two-sided, two-sample Kolmogorov-Smirnov test

SW

test statistic of a Shapiro-Wilks test

pSW

$P$-value of a Shapiro-Wilks test

Examples

Run this code
# NOT RUN {
# discrete empirical data
x <- rnbinom(100, 0.5, 0.2)
r <- fitter(x, dom="dis", posList=list(stats=NA))
# create only 'shiny' app
out <- printReport(r, type="shiny")
names(out)
# }
# NOT RUN {
 out$shiny 
# }
# NOT RUN {
out <- printReport(r, type=c("csv")) # warning as 'file' is NULL, 
str(out) # but table (data.frame) returned

# }

Run the code above in your browser using DataLab