asCOMArray            package:RDCOMClient            R Documentation

_C_r_e_a_t_e _C_O_M _S_A_F_E_A_R_R_A_Y _f_r_o_m _R _m_a_t_r_i_x

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

     This creates a COM array from the contents of a two-dimensional R
     matrix or data frame.  This can be used within R to explicitly
     coerce an R object before it is passed to the COM mechanism as an
     argument or return value of a function.  Otherwise, the automatic
     converter mechanism creates a dynamic COM object that points to
     this S object which loses no information (e.g. column or row
     names, etc.) This currently only handles basic types in S, i.e.
     integer, numeric,  logical and character elements. In the future,
     we will provide functions for creating an arbitrary SAFEARRAY and
     populating it in steps directly from R.

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

     asCOMArray(obj)

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

     obj: an S object that is converted to a matrix and whose resulting
          contents are copied into the  COM array. 

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

     An object which is an external pointer to the  newly created
     SAFEARRAY.

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

     Duncan Temple Lang (duncan@wald.ucdavis.edu)

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.omegahat.org/RDCOMClient> <URL:
     http://www.omegahat.org/RDCOMServer> <URL:
     http://www.omegahat.org/SWinTypeLibs>

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

     '.COM' 'createCOMObject'

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

     ## Not run: 
       r = sheet$Range("A1:C10")
       r[["Value"]] <- asCOMArray(matrix(rnorm(30, 10, 3)))
     ## End(Not run)

