http://dirk.eddelbuettel.com/code/rcpp.html

I quote:
Overview The Rcpp package provides C++ classes that greatly facilitate
interfacing C or C++ code in R packages using the .Call() interface
provided by R. Rcpp provides matching C++ classes for a large number of
basic R data types. Hence, a package author can keep his data in normal R
data structures without having to worry about translation or transfering to
C++. At the same time, the data structures can be accessed as easily at the
C++ level, and used in the normal manner. The mapping of data types works
in both directions. It is as straightforward to pass data from R to C++, as
it is it return data from C++ to R. The following two sections list
supported data types.

That describes, to me, an almost nearly perfectly ideal API between opencog
and R.

In our case, (my case) I have a 2D matrix, which is an (evaluationlink
(predicate "foo") (List x,y)) and the x,y are the coordinates of the
matrix.  If R asks for x,y, and I have this eval link, then I return the TV
on it. If I don't have this pair, I return zero.  And vice versa: if R asks
me to store a value for x,y, then just create BlahNode X and blortNode Y
and stuff them into the evaluation link, store the number the TV or other
value, and you're done. generic atomspace values work, now. they are
vectors of floats strings or other values.

https://journal.r-project.org/archive/2011-2/RJournal_2011-2_Plummer.pdf


--linas

On Sat, Jun 17, 2017 at 10:52 PM, Ben Goertzel <[email protected]> wrote:

> On Sun, Jun 18, 2017 at 11:43 AM, Linas Vepstas <[email protected]>
> wrote:
> > 4) I have no clue at all on how R accesses data. Can't you write some
> small
> > shim, that allows R to reach into opencog to get the data it needs?  How
> > hard can this be?  Surely lots of people do something like this, right?
>
>
> We'll see...
>
> We have an R wrapper for MOSES now which is being used to apply MOSES
> to genomic data...
>
> Now Hedra and Mike are experimenting with PLN backward chaining
> inference on bio-data in the Atomspace (building on stuff Eddie and
> Misgana did way back w/ the forward chainer)... we will want to make
> some good way to access this from R, but need to figure out what this
> will be....
>
>
>
>
> --
> Ben Goertzel, PhD
> http://goertzel.org
>
> "I am God! I am nothing, I'm play, I am freedom, I am life. I am the
> boundary, I am the peak." -- Alexander Scriabin
>
> --
> You received this message because you are subscribed to the Google Groups
> "opencog" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/opencog.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/opencog/CACYTDBcOXjh%2B7phfib1Os-f5WJso9V-
> zhBs5bPnmH8c9k_0w8Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/opencog/CAHrUA34rT3Mw1vwG5n-SFgUX30VjGGO5ibAz9KfUcWxLpWGTfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to