Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

n22dig

Show vector or matrix (of 0 <= x <=10) in a compact way


Description

n22dig shows as two characters: "0.ab" as "ab", "1.00" as " I", "0" as " 0" (note the blank).

Usage

n22dig(x, symm = TRUE)

Arguments

x

A numerical vector or matrix with elements <= 1.

symm

If symm = TRUE then upper triangle will be shown as " ".

Value

Representation of x as two-digit vector or matrix.

Note

A violation of the condition on abs(x) will not be signalled. Empty places due to symm = TRUE are filled with " ".

Author(s)

Christian W. Hoffmann <christian@echoffmann.ch>

See Also

n2c.

Examples

n22dig(cor(matrix(rnorm(100),10)),TRUE)
#       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#  [1,] " I" " "  " "  " "  " "  " "  " "  " "  " "  " "  
#  [2,] "10" " I" " "  " "  " "  " "  " "  " "  " "  " "  
#  [3,] " 8" "26" " I" " "  " "  " "  " "  " "  " "  " "  
#  [4,] " 8" "49" " 2" " I" " "  " "  " "  " "  " "  " "  
#  [5,] " 8" "22" " 9" "46" " I" " "  " "  " "  " "  " "  
#  [6,] "40" "26" " 5" "27" "14" " I" " "  " "  " "  " "  
#  [7,] " 8" "15" "21" "58" "13" "26" " I" " "  " "  " "  
#  [8,] "13" "30" " 2" "58" "21" "41" "61" " I" " "  " "  
#  [9,] "46" "22" " 7" "63" "15" "25" "43" "36" " I" " "  
# [10,] "66" "51" "48" "16" "20" "27" "28" "20" "16" " I"

cwhmisc

Miscellaneous Functions for Math, Plotting, Printing, Statistics, Strings, and Tools

v6.6
GPL (>= 2)
Authors
Christian W. Hoffmann
Initial release
2018-08-24, 10:40:10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.