RCall.CharSxp —Type.R character string
RCall.ClosSxp —Type.R function closure
RCall.CplxSxp —Type.R complex vector
RCall.EnvSxp —Type.R environment
RCall.IntSxp —Type.R integer vector
RCall.LangSxp —Type.R function call
RCall.LglSxp —Type.R logical vector
RCall.ListSxp —Type.R pairs (cons) list cell
RCall.NilSxp —Type.R NULL value
RCall.RObject —Type.AnRObject is a Julia wrapper for an R object (known as an "S-expression" or "SEXP"). It is stored as a pointer which is protected from the R garbage collector, until theRObject itself is finalized by Julia. The parameter is the type of the S-expression.
When called with a Julia object as an argument, a corresponding R object is constructed.
julia> RObject(1)RObject{IntSxp}[1] 1julia> RObject(1:3)RObject{IntSxp}[1] 1 2 3julia> RObject(1.0:3.0)RObject{RealSxp}[1] 1 2 3RCall.RealSxp —Type.R real vector
RCall.S4Sxp —Type.R S4 object
RCall.StrSxp —Type.R vector of character strings
RCall.Sxp —Type.RCall.jl's typeSxp mirrors the R symbolic expression recordSEXPREC in R API. These are represented by a pointerPtr{S<:Sxp} (which is calledSEXP in R API).
RCall.VecSxp —Type.R list (i.e. Array{Any,1})
RCall.AnySxp —Type.R "any" object
RCall.BcodeSxp —Type.R byte code
RCall.BuiltinSxp —Type.R built-in function
RCall.DotSxp —Type.R dot-dot-dot object
RCall.ExprSxp —Type.R expression vector
RCall.ExtPtrSxp —Type.R external pointer
RCall.PromSxp —Type.R promise
RCall.RClass —Type.R Class
RCall.RawSxp —Type.R byte vector
RCall.SpecialSxp —Type.R special function
RCall.SxpHead —Type.R Sxp header: a pointer to this is used for unknown types.
RCall.SymSxp —Type.R symbol
RCall.WeakRefSxp —Type.R weak reference
RCall.anyna —Method.Check if there are any NA values in the vector.
RCall.getattrib —Method.Return a particular attribute of an RObject
RCall.getclass —Method.Returns the class of an R object.
RCall.getnames —Method.Returns the names of an R vector.
RCall.isna —Method.Check if the ith member of s coorespond to R's NA values.
RCall.isna —Method.Check if the members of a vector are NA values. Always return a BitArray.
RCall.isnull —Method.Check if values correspond to R's NULL object.
RCall.rcall —Method.Evaluate a function in the global environment. The first argument corresponds to the function to be called. It can be either a FunctionSxp type, a SymSxp or a Symbol.
RCall.rcopy —Method.rcopy(r) copies the contents of an R object into a corresponding canonical Julia type.
RCall.reval —Function.Evaluate an R symbol or language object (i.e. a function call) in an R try/catch block, returning an RObject.
RCall.rimport —Function.Import an R package as a julia module.
gg = rimport("ggplot2")RCall.rlang —Method.Create a function call from a function pointer and a list of arguments and return it as an RObject, which can then be evaulated
RCall.robject —Method.robject(x) converts a Julia objectx to a corresponding RObject implictly. Explict conversions could be called withrobject(<R Class>, x).
RCall.rparse —Method.Parse a string as an R expression, returning an RObject.
RCall.rprint —Method.Print the value of an Sxp using R's printing mechanism
RCall.setattrib! —Method.Set a particular attribute of an RObject
RCall.setclass! —Method.Set the class of an R object.
RCall.setnames! —Method.Set the names of an R vector.
RCall.sexp —Method.sexp(x) converts a Julia objectx to a pointer to a corresponding Sxp Object.
RCall.sexp —Method.Convert aPtr{UnknownSxp} to an approptiatePtr{S<:Sxp}.
RCall.sexp —Method.Wrap a Julia object an a RPtr{ExtPtrSxp}.
We store the pointer and the object in a const Dict to prevent it being removed by the Julia GC.
RCall.sexp —Method.Wrap a callable Julia objectf an a RClosSxpPtr.
Constructs the following R code
function(...) .External(juliaCallback, fExPtr, ...)Base.eltype —Method.Element types of R vectors.
Base.getindex —Method.extract the value of symbol s in the environment e
Base.getindex —Method.extract an element from a S4Sxp by label
Base.getindex —Method.extract an element from a PairListSxp by label
Base.getindex —Method.Set element of a VectorSxp by a label.
Base.getindex —Method.extract the i-th element of a PairListSxp
Base.isascii —Method.Determines the encoding of the CharSxp. This is determined by the 'gp' part of the sxpinfo (this is the middle 16 bits).
We only support ASCII and UTF-8.
Base.length —Method.Sxp methods forlength return the R length.
Rf_xlength handles Sxps that are not vector-like and R's "long vectors", which have a negative value for thelength member.
Base.names —Method.Returns the names of an R vector, the result is converted to a Julia symbol array.
Base.setindex! —Method.assign value v to symbol s in the environment e
Base.setindex! —Method.extract an element from a S4Sxp by label
Base.setindex! —Method.Set element of a PairListSxp by a label.
Base.setindex! —Method.Set element of a VectorSxp by a label.
Base.setindex! —Method.assign value v to the i-th element of a PairListSxp
Base.size —Method.Returns the size of an R object.
RCall.bound —Method.The R NAMED property, represented by 2 bits in the info field. This can take values 0,1 or 2, corresponding to whether it is bound to 0,1 or 2 or more symbols. See http://cran.r-project.org/doc/manuals/r-patched/R-exts.html#Named-objects-and-copying
RCall.decref_extptr —Method.Called by the R finalizer.
RCall.endEmbeddedR —Method.endEmbeddedR()Close embedded R session.
RCall.event_callback —Method.Event Callback: allows R to process Julia events when R is busy. For example, writing output to stdout while running an expensive R command.
RCall.findNamespace —Method.find namespace by name of the namespace, it is not error tolerant.
RCall.getNamespace —Method.get namespace by name of the namespace. It is safer to be used than findNamespace as it checks bound.
RCall.getParseErrorMsg —Method.Get the R parser error msg for the previous parsing result.
RCall.ijulia_displayplots —Method.Called after cell evaluation. Closes graphics device and displays files in notebook.
RCall.ijulia_setdevice —Method.Set options for R plotting with IJulia.
The first argument should be a MIME object: currently supported are
MIME("image/png") [default]MIME("image/svg+xml")The remaining arguments (keyword only) are passed to the appropriate R graphics device: see the relevant R help for details.
RCall.initEmbeddedR —Method.initEmbeddedR()This initializes an embedded R session. It should only be called when R is not already running (e.g. if Julia is running inside an R session)
RCall.isNA —Method.Check if a value corresponds to R's sentinel NA values. These function should not be exported.
RCall.julia_extptr_callback —Method.The function called by R .External for Julia callbacks.
It receives aPtr{ListSxp} containing
Ptr{ExtPtrSxp})Ptr{ExtPtrSxp})Ptr{S<:Sxp})RCall.makeExternalPtr —Function.Create an Ptr{ExtPtrSxp} object
RCall.makeNativeSymbolRef —Method.Register a function pointer as an R NativeSymbol. We technically are supposed to use RregisterRoutines. Starting from R 3.4, `RMakeExternalPtrFn` is a part of R API in R 3.4. It is probably safe to such to make the external pointer.
RCall.naeltype —Method.NA element for each R base class
RCall.newEnvironment —Method.newEnvironment([env])Create a new environment which extends environmentenv (globalEnv by default).
RCall.parseVector —Method.A pure julia wrapper of R_ParseVector
RCall.prepare_inline_julia_code —Function.Prepare code for evaluating the julia expressions. When the code is execulated, the results are stored in the R environment#JL.
RCall.preserve —Method.Prevent garbage collection of an R object. Object can be released viarelease.
This is slower thanprotect, as it requires searching an internal list, but more flexible.
RCall.protect —Method.Stack-based protection of garbage collection of R objects. Objects are released viaunprotect. Returns the same pointer, allowing inline use.
This is faster thanpreserve, but more restrictive. Really only useful inside functions.
RCall.rcall_p —Method.Evaluate a function in the global environment. The first argument corresponds to the function to be called. It can be either a FunctionSxp type, a SymSxp or a Symbol.
RCall.registerCFinalizerEx —Method.Register finalizer to be called by the R GC.
RCall.release —Method.Release object that has been gc protected bypreserve.
RCall.render —Method.Render an inline R script, substituting invalid "$(Expr(:incomplete, "incomplete: invalid string syntax"))
RCall.reval_p —Method.Evaluate an R expression array iteratively. Ifthrow_error isfalse, the error message and warning will be thrown to stderr.
RCall.reval_p —Method.Evaluate an R symbol or language object (i.e. a function call) in an R try/catch block, returning a Sxp pointer.
RCall.rlang_p —Method.Create a function call from a list of arguments
RCall.rparse_p —Method.Parse a string as an R expression, returning a Sxp pointer.
RCall.safe_parseVector —Method.RParseVector wrapped by RtryCatchError. It catches possible R'sstop calls which may cause longjmp in c.
RCall.set_last_value —Method.Set the variable .Last.value to a given value
RCall.sexp_arglist_dots —Method.Create an argument list for an R function call, with a varargs "dots" at the end.
RCall.sexpnum —Method.The SEXPTYPE number of aSxp
Determined from the trailing 5 bits of the first 32-bit word. Is a 0-based index into theinfo field of aSxpHead.
RCall.tryEval —Method.A pure julia wrapper of R_tryEval.
RCall.unprotect —Method.Release lastn objects gc-protected byprotect.
RCall.unsafe_array —Method.The same asunsafe_vec, except returns an appropriately sized array.
RCall.unsafe_vec —Method.Represent the contents of a VectorSxp type as aVector.
This doesnot copy the contents. If the argument is not named (in R) or otherwise protected from R's garbage collection (e.g. by keeping the containing RObject in scope) the contents of this vector can be modified or could cause a memory error when accessed.
The contents are as stored in R. Missing values (NA's) are represented in R by sentinels. Missing data values in RealSxp and CplxSxp show up asNaN andNaN + NaNim, respectively. Missing data in IntSxp show up as-2147483648, the minimum 32-bit integer value. Internally aLglSxp is represented asVector{Int32}. The convention is that0 isfalse,-2147483648 isNA and all other values representtrue.
RCall.validate_libR —Function.validate_libR(libR, raise=true)Checks that the R librarylibR can be loaded and is satisfies version requirements.
Ifraise is set tofalse, then returns a boolean indicating success rather than throwing exceptions.
RCall.write_console_ex —Method.R API callback to write console output.
RCall.@R_str —Macro.R"..."An inline R expression, the result of which is evaluated and returned as anRObject.
It supports substitution of Julia variables and expressions via prefix with$ whenever not valid R syntax (i.e. when not immediately following another completed R expression):
R"glm(Sepal.Length ~ Sepal.Width, data=$iris)"It is also possible to pass Julia expressions:
R"plot(getfield(RCall, Symbol("##49#50"))())"All such Julia expressions are evaluated once, before the R expression is evaluated.
The expression does not support assigning to Julia variables, so the only way retrieve values from R via the return value.
RCall.@rget —Macro.Copies variables from R to Julia using the same name.
RCall.@rimport —Macro.Import an R Package as a Julia module. For example,
@rimport ggplot2is equivalent toggplot2 = rimport("ggplot2") with error checking.
You can also use classic Python syntax to make an alias:@rimport *package-name* as *shorthand*
@rimport ggplot2 as ggwhich is equivalent togg = rimport("ggplot2").
RCall.@rlibrary —Macro.Load all exported functions/objects of an R package to the current module. Almost equivalent to
__temp__ = rimport("ggplot2")using .__temp__RCall.@rput —Macro.Copies variables from Julia to R using the same name.
RCall.@var_str —Macro.Returns a variable named "str". Useful for passing keyword arguments containing dots.
RCall.globalEnv —Constant.R global Environment.
globalEnv[:x] = 1globalEnv[:x]RCall.jtypExtPtrs —Constant.Julia types (typically functions) which are wrapped inPtr{ExtPtrSxp} are stored here to prevent garbage collection by Julia.
RCall.typs —Constant.vector of R Sxp types