label                package:SASxport                R Documentation

_S_e_t _o_r _R_e_t_r_e_i_v_e _t_h_e '_l_a_b_e_l', '_S_A_S_f_o_r_m_a_t', _o_r '_S_A_S_i_f_o_r_m_a_t' _A_t_t_r_i_b_u_t_e _o_f _a _V_e_c_t_o_r

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

     Sets or retrieves the '"label"', '"SASformat"', or '"SASiformat"'
     attribute of an object.

     More comprehensive support for object labels, and SASformat, are
     available in Frank Harrell's 'Hmisc' package.

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

     label(x, default)
     label(x) <- value

     SASformat(x, default)
     SASformat(x) <- value

     SASiformat(x, default)
     SASiformat(x) <- value

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

       x: any object

   value: new value for the  '"label"', '"SASformat"', or
          '"SASiformat"' attribute of an object.

 default: value to return when no appropriate attribute is found.  The
          usual return value is NULL.

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

     the contents of the '"label"', '"SASformat"', or '"SASiformat"'
     attribute of x, if any; otherwise, the value provided by
     'default'.

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

     Gregory R. Warnes greg@random-techologies-llc.com based on code
     from the 'Hmisc' library by Frank E. Harrell, Jr.

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

     fail.time <- c(10,20)

     # set attributes
     label(fail.time) <- 'Failure Time'
     SASformat(fail.time) <- 'Numeric2'
     SASiformat(fail.time) <- 'Numeric2'

     # display individual attributes
     label(fail.time)
     SASformat(fail.time)
     SASiformat(fail.time)

     # display all attributes
     attributes(fail.time)

     # Example showing specification of default return value
     a <- 70
     label(a, default="no label")

     ## Not run: 
     # for a nice display
     library(Hmisc)
     describe(fail.time)

     f <- cph(Surv(fail.time, event) ~ xx)
     plot(xx,xx2,xlab=label(xx),"s",sep=""))
     ## End(Not run)

