asCOMArray {RDCOMClient} | R Documentation |
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.
asCOMArray(obj)
obj |
an S object that is converted to a matrix and whose resulting contents are copied into the COM array. |
An object which is an external pointer to the newly created SAFEARRAY.
Duncan Temple Lang (duncan@research.bell-labs.com)
http://www.omegahat.org/RDCOMClient http://www.omegahat.org/RDCOMServer http://www.omegahat.org/SWinTypeLibs
## Not run: r = sheet$Range("A1:C10") r[["Value"]] <- asCOMArray(matrix(rnorm(30, 10, 3))) ## End(Not run)