n2c                package:cwhstring                R Documentation

_S_h_o_w _a_b_s_o_l_u_t_e _v_a_l_u_e_s _a_s _c_h_a_r_a_c_t_e_r_s, _p_r_e_p_a_r_e _f_o_r _p_l_o_t_t_i_n_g

_D_e_s_c_r_i_p_t_i_o_n:

     'n2c' takes a numerical vector or matrix and represents it as
     single characters, with legend. 'indexLine' generates a string
     with dots, ";", and digits, usable as x-label in 'n2cCompact':
     .....;....1....;....2.. 'n2cCompact' combines 'n2c' and
     'indexLine' to generate a vector of strings good for printing
     numerical matrices. 'charMat' processes the output from
     'n2cCompact' and returns vectors x, y, tx of equal lengths for
     input to 'pltCharMat'

_U_s_a_g_e:

       n2c(x, symm = FALSE)
       indexLine(n)
       n2cCompact(x, symm=FALSE)
       charMat(cc)

_A_r_g_u_m_e_n_t_s:

       x: A numerical vector or matrix.

    symm: If 'symm = TRUE' then upper triangle will be suppressed.

       n: integer, length of string wanted

      cc: output from 'n2cCompact', input to 'charMat'

_V_a_l_u_e:

     'n2c:' Representation of 'x' as a single-character vector or
     matrix, as explained in _attribute_ 'legend'. 'charMat:'
     list(x,y,txt)

_N_o_t_e:

     Empty places due to 'symm = TRUE' are filled with " ".

_A_u_t_h_o_r(_s):

     Christian W. Hoffmann, christian.hoffmann@wsl.ch, <URL:
     http://www.wsl.ch/staff/christian.hoffmann>

_S_e_e _A_l_s_o:

     'n22dig'.

_E_x_a_m_p_l_e_s:

     n2c(c(10e20,-10e5,20,10,0.9,-0.7,0.6,0,-0.5,0.1))
     n2c(matrix(c(10e20,10e5,20,10,0.7,0.6,0,0.5,0.1),3,3),FALSE)
     #      [,1] [,2] [,3]
     # [1,] "X"  "1"  " " 
     # [2,] "5"  "#"  "=" 
     # [3,] "1"  "*"  "," 
     # attr(,"legend")
     # [1] ">=1: log, >=0. 9& 8% 7# 6* 5= 4+ 3- 2: 1, 05. ' ' "
     m <- matrix(rnorm(500),nrow=50,ncol=10)
     n2c(m,symm=TRUE)
     indexLine(ncol(m))
     (n2 <- n2cCompact(m, symm=FALSE))
     charMat(n2)

