Struct roxido::r::Rval [−][src]
#[repr(C)]pub struct Rval(pub SEXP);
Expand description
A Rust representation of an R object.
Technically, this is simply a Rust new type idiom (newtype) for R’s SEXP
, a pointer to R’s SEXPREC
structure.
Tuple Fields
0: SEXP
Implementations
Define a new vector with storage mode double
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Define a new vector with storage mode integer
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Define a new vector with storage mode logical
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Define a new vector with storage mode character
.
Define a new vector with storage mode raw
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Define a new matrix with storage mode double
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
pub fn new_matrix_integer(
nrow: usize,
ncol: usize,
pc: &mut Pc
) -> (Self, &'static mut [i32])
pub fn new_matrix_integer(
nrow: usize,
ncol: usize,
pc: &mut Pc
) -> (Self, &'static mut [i32])
Define a new matrix with storage mode integer
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
pub fn new_matrix_logical(
nrow: usize,
ncol: usize,
pc: &mut Pc
) -> (Self, &'static mut [i32])
pub fn new_matrix_logical(
nrow: usize,
ncol: usize,
pc: &mut Pc
) -> (Self, &'static mut [i32])
Define a new matrix with storage mode logical
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Define a new matrix with storage mode character
.
Define a new error.
This does not throw an error. Instead, simply use panic!
.
Define a new element for a character vector.
An element of a character vector should generally not be returned to a user, but this
function can be used in conjunction with Self::set_character_element
.
Define a new symbol.
Duplicate an object.
When assignments are done in R such as
Since multiple symbols may be bound to the same object, if the usual R semantics are to
apply, any code which alters one of them needs to make a copy before modifying the copy.
This method is commonly called on arguments to .Call
before modifying them.
Get R’s definition of the Inf
value.
Get R’s definition of the -Inf
value.
Get R’s definition of the NA
value of storage mode integer
.
Get R’s definition of the NA
value of storage mode logical
.
Get R’s definition of the NA
value for an element of an object of storage mode character
.
Test if value is NA for storage mode double
.
Test if value is NA for storage mode integer
.
Test if value is NA for storage mode logical
.
Test if value is NA for an element of an object of storage mode character
.
Is the object of storage mode integer
?
Is the object of storage mode double
or integer
?
Is the object of storage mode double
or integer
and of length one?
Is the object of storage mode logical
?
Is the object an element of an object of storage mode character
?
Is the object of storage mode character
?
Is the object an atomic vector?
Is the object a square matrix?
Is the object a data.frame?
Is the object a function?
Is the object an environment?
Get an element of a character vector, with indexing starting at zero.
Panics
This function panics if the object is not a character vector or if i
is greater than or equal to the length of the vector.
Set an element of a character vector, with indexing starting at zero.
Panics
This function panics if the object is not a character vector or if i
is greater than or equal to the length of the vector.
Get an element of a list, with indexing starting at zero.
Panics
This function panics if the object is not a list or if i
is greater than or equal to the length of the list.
Set an element of a list, with indexing starting at zero.
Panics
This function panics if the object is not a list or if i
is greater than or equal to the length of the list.
Get an attribute.
Set an attribute.
Create a new binding (or changes the value of an existing binding) in the specified environment frame. It is the analogue of assign(self, value, envir = environment, inherits = FALSE)
.
Panics
The function panics if the object is not a symbol.
Search for an existing binding in the specified environment or its enclosing environments. If a binding is found, its value is changed to value
. Otherwise, a new binding is created in the global environment. This corresponds to assign(self, value, envir = environment, inherits = TRUE)
.
Panics
The function panics if the object is not a symbol.
Set the names attribute of an object.
Panics
The function panics if names
is not an vector object of the same length as the object.
Set the class attribute of an object.
Panics
The function panics if value
is not a character vector.
Coerce the object to an f64
value (potentially leading to an NA
/NaN
value).
Coerce the object to an i32
value (potentially leading to an NA
/NaN
value).
Coerce the object to a bool
value (potentially leading to an NA
/NaN
value).
Coerce the object to a usize
value (potentially leading to an NA
/NaN
value), setting negative values to zero.
Coerce the object to storage mode character
and get the associated String
value.
If coercion is not possible (because, for example, no UTF-8 representation exists), ""
is returned.
Get an f64
slice associated with the object, or an error if the object is not of storage mode double
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Get an i32
slice associated with the object, or an error if the object is not of storage mode integer
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Get an i32
slice (of logical values) associated with the object, or an error if the object is not of storage mode logical
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Get an u8
slice associated with the object, or an error if the object is not of storage mode raw
.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Coerce the object to storage mode double
and get the associated slice, or return an error if not possible.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Coerce the object to storage mode integer
and get the associated slice, or return an error if not possible.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Coerce the object to storage mode logical
and get the associated slice, or return an error if not possible.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Coerce the object to storage mode raw
and get the associated slice, or return an error if not possible.
Although the stated lifetime is 'static
, the reference is actually only valid as long as
the associated R object exists.
Coerce the object to storage mode character
, or return an error if not possible.
Call a function with no arguments.
Safety
This function will cause a long jump (leading to a memory leak) if the R function throws any errors.
Using Self::call0
is the safe alternative, with slightly more overhead.
Call a function with one argument.
Safety
This function will cause a long jump (leading to a memory leak) if the R function throws any errors.
Using Self::call1
is the safe alternative, with slightly more overhead.
Call a function with two arguments.
Safety
This function will cause a long jump (leading to a memory leak) if the R function throws any errors.
Using Self::call2
is the safe alternative, with slightly more overhead.
Call a function with three arguments.
Safety
This function will cause a long jump (leading to a memory leak) if the R function throws any errors.
Using Self::call3
is the safe alternative, with slightly more overhead.
Call a function with four arguments.
Safety
This function will cause a long jump (leading to a memory leak) if the R function throws any errors.
Using Self::call4
is the safe alternative, with slightly more overhead.
pub unsafe fn call5_unsafe(
self,
x1: Self,
x2: Self,
x3: Self,
x4: Self,
x5: Self,
pc: &mut Pc
) -> Self
pub unsafe fn call5_unsafe(
self,
x1: Self,
x2: Self,
x3: Self,
x4: Self,
x5: Self,
pc: &mut Pc
) -> Self
Call a function with five arguments.
Safety
This function will cause a long jump (leading to a memory leak) if the R function throws any errors.
Using Self::call5
is the safe alternative, with slightly more overhead.
Evaluation a expression, returning the value or an error code.
Call a function with no arguments, returning the value or an error code.
Call a function with one argument, returning the value or an error code.
Call a function with two arguments, returning the value or an error code.
Call a function with three arguments, returning the value or an error code.
Call a function with four arguments, returning the value or an error code.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Rval
impl UnwindSafe for Rval
Blanket Implementations
Mutably borrows from an owned value. Read more