Learn R Programming

FatTailsR (version 2.0.0)

roundcoefk: Round Coefk

Description

Round coefk parameters in a standard manner or in a special manner, the latest being useful to display nice matrix or data.frame.

Usage

roundcoefk(coefk, dgts = NULL, parnames = TRUE)

Arguments

coefk

numeric, matrix or data.frame representing parameters c(m,g,a,k,w,d,e).

dgts

integer. The number of rounded digits.

parnames

boolean. Output displayed with or without parameter names.

Details

For dgts between 1 and 9, rounding is done in the standard way and all parameters are rounded at the same number of digits.

For dgts between 10 and 27, rounding of parameters c(m,g,a,k,w,d,e) is done in the following way:

  • dgts = 10 : c(0, 0, 1, 1, 1, 3, 2)

  • dgts = 11 : c(1, 1, 1, 1, 1, 3, 2)

  • dgts = 12 : c(2, 2, 1, 1, 1, 3, 2)

  • dgts = 13 : c(3, 3, 1, 1, 1, 3, 2)

  • dgts = 14 : c(4, 4, 1, 1, 1, 3, 2)

  • dgts = 15 : c(5, 5, 1, 1, 1, 3, 2)

  • dgts = 16 : c(0, 0, 2, 2, 2, 3, 2)

  • dgts = 17 : c(1, 1, 2, 2, 2, 3, 2)

  • dgts = 18 : c(2, 2, 2, 2, 2, 3, 2)

  • dgts = 19 : c(3, 3, 2, 2, 2, 3, 2)

  • dgts = 20 : c(4, 4, 2, 2, 2, 3, 2)

  • dgts = 21 : c(5, 5, 2, 2, 2, 3, 2)

  • dgts = 22 : c(0, 0, 3, 3, 3, 4, 3)

  • dgts = 23 : c(1, 1, 3, 3, 3, 4, 3)

  • dgts = 24 : c(2, 2, 3, 3, 3, 4, 3)

  • dgts = 25 : c(3, 3, 3, 3, 3, 4, 3)

  • dgts = 26 : c(4, 4, 3, 3, 3, 4, 3)

  • dgts = 27 : c(5, 5, 3, 3, 3, 4, 3)

Examples

Run this code
    

mat   <- matrix(runif(35), ncol=7) 
coefk <- mat[1,]

roundcoefk(coefk, dgts = 2, parnames = FALSE)
roundcoefk(coefk, dgts = 15)
roundcoefk(mat, dgts = 15)


Run the code above in your browser using DataLab