NanotimeToNanotime: nanotime to nanotime round-trip demo

View source: R/RcppExports.R

NanotimeToNanotimeR Documentation

nanotime to nanotime round-trip demo

Description

This function takes an nanotime-valued input vector, converts it to the equivalent int64_t vector in C++, displays each element after first adding one, and returns the modified vector.

Usage

NanotimeToNanotime(vec)

Arguments

vec

A nanotime-classed vector from R

Value

A modified nanotime vector where each element increased by one

Examples

# generate all powers of 10 fro 0 .. 18
if (requireNamespace("nanotime", quietly=TRUE)) {
    v <- nanotime::as.nanotime(10^seq(0,18))
    # pass them to function which will add one to each, print  and return
    NanotimeToNanotime(v)
}

RcppInt64 documentation built on May 29, 2024, 1:29 a.m.