Skip to content
Back to formatted view

Raw Message

Message-ID: <4E2984F2.6060405@gmail.com>
Date: 2011-07-22T14:10:58Z
From: Renaud Gaujoux
Subject: [Rcpp-devel] Rcpp: accessing non exported function in a given namespace

Hi,

I am using Rcpp in a package and I need to get a non exported function 
in some other namespace.
I do something like the following but it seems to work only for exported 
functions (or I guess any R variables):

Environment ns = Environment("package:stats");
Function fun = ns[".asSparse"];

This throws an error: "cannot convert to function".
I am running:
- R-2.13.0 on Ubuntu 10.04
- Rcpp 0.9.5

Actually, I would like to access any type of non-exported R variable, 
but I imagine it would work the same and changing the left-side class 
should do the trick.

I am sure there is an easy way to do this in Rcpp. Any suggestion?
Thank you.

Bests,
Renaud