All data in R is stored in an opaque struct called sexprec. Data is passed around as pointers to sexprec structs called SEXP. That's an unfortunate name (it stands for s-expression because R started out as a Scheme dialect) so I use Robj instead.
For use inside D functions called from R.
This function adds the boilerplate needed inside a shared library that will be called from R.
Unless otherwise noted from here down, if the argument * name is the same as it is in R, the argument is the same. * Some R arguments are not available in C
scale = 1/rate
These do not allow for passing argument rate as in R Confirmed that otherwise you call them the same as in R
Use these if you want to set ncp as in R
Same arguments as the R functions
Same arguments as the R functions
Create a copy of a matrix.
For embedding an R interpreter inside D.
For embedding an R interpreter inside D.
For embedding an R interpreter inside D.
Calculate exp(x)-1 for small x
R's signif() function
Returns element ii from the bottom.
R's round() function
|x|*sign(y) Gives x the same sign as y
Truncate towards zero
Not normally called unless you're working on the embedr library itself.
Returns true if x holds a vector of integers.
Returns true if x holds a matrix.
Returns true if x holds a vector of integers or doubles.
Returns true if x is a vector object.
Returns the last element of an RVector.
All R objects have a length attribute. You can call this function on any R object and it will return a value. The most common usage is to get the length of a vector, but it can be called on anything.
Calculate log(1+x) for small x
If x has a names attribute attached to it, this function will copy the names into a string[].
Print a matrix, with an optional message.
Tells the R interpreter to print something out. This is generally useful only if you want to use the formatting provided by R. Most of the time, want to do your printing from D.
Creates a new R object with room for one double value and copies x into it.
Creates a new R object with room to hold v.length double values and copies v into it.
Creates a new R object with room for one int value and copies x into it.
Creates a new R object with room for one string and copies s into it.
Creates a new R object with room to hold sv.length strings and copies sv into it.
Pull the value out of an R object holding one double value.
Pull the value out of an R object holding one int value.
Pull the value out of an R object holding one int value.
Pull the value out of an R object holding one int value.
Pull the value out of an R object holding one string.
Convenience function to pull a double value out of R. Only used when embedding an R interpreter inside a D program.
Convenience function to pull an int value out of R. Only used when embedding an R interpreter inside a D program.
Convenience function to pull an int value out of R. Only used when embedding an R interpreter inside a D program.
Convenience function to pull an int value out of R. Only used when embedding an R interpreter inside a D program.
Convenience function to pull a string out of R. Only used when embedding an R interpreter inside a D program.
Not normally called unless you're working on the embedr library itself.
Returns 1 for positive, 0 for zero, -1 for negative
Tells R to source the file s.
Copies a string array from a character vector in R into a D string array.
Convenience function to pull the character vector name from R into D.
When embedding an R interpreter inside D, this function passes data from D to R, copying as necessary.
Copies a string allocated in R into a D string.
Copies a string allocated in R from a character vector into a D string.
Returns the time series properties of an R object. If rv is not a ts object, will throw an error.
Enables reference counting of objects allocated by R. It takes care of protecting and unprotecting objects from the R garbage collector.
Same as RVector, but holds a vector of integers instead of a vector of doubles.
The most common way to pass multiple pieces of data in R is by putting them into a list. If you pass a list from R to D, you need some way to work with that data. If you want to return multiple items from D to R, the only way to do that is with a list.
This struct is used to work with a matrix that has been allocated in R. A pointer to the data is held, along with the dimensions. An RMatrix struct is reference counted to take care of protecting it from the R garbage collector while in use, and unprotecting when it is no longer used, as necessary.
Enables reference counting of objects allocated by R. It takes care of protecting and unprotecting objects from the R garbage collector.
Support for passing strings from D to R and vice versa.
This struct is used to work with a vector that has been allocated in R. A pointer to the data is held, along with the dimensions. An RVector struct is reference counted to take care of protecting it from the R garbage collector while in use, and unprotecting when it is no longer used, as necessary.
All data in R is stored in an opaque struct called sexprec. Data is passed around as pointers to sexprec structs called SEXP. That's an unfortunate name (it stands for s-expression because R started out as a Scheme dialect) so I use Robj instead.
Constants pulled from the R API, for compatibility
This module provides an interface to the R API. It allows you to write D functions that can be called from R and also provides support for embedding an R interpreter inside a D program. That means you have access to all R libraries from within a D program. Data is passed between the two languages using pointers. This modules defines structs that handle protecting/unprotecting data from the R garbage collector.
This file contains everything you need to create a shared library on Linux or Mac that can be called from R. On Windows, you will also need the R.lib file provided inside the repo.