R/cxxfunction.copy.R

Defines functions cxxfunction.copy

Documented in cxxfunction.copy

## File Name: cxxfunction.copy.R
## File Version: 1.06


cxxfunction.copy <- function( cppfct, name )
{
    require_namespace("inline")
    g1 <- inline::getDynLib(cppfct)
    cppname <- gsub( "\\.dll", "\\.cpp",  g1[["path"]] )
    h1 <- readLines( cppname )
    tempname <- g1[["name"]]
    h1 <- gsub( tempname, name, h1 )
    h1 <- c( paste0( "//  Code created: ", Sys.time() ), "", h1 )
    name1 <- paste0( tolower(name), ".cpp" )
    writeLines( h1, name1 )
    crlrem( filename1=name1, filename2=name1 )
}

Try the miceadds package in your browser

Any scripts or data that you put into this service are public.

miceadds documentation built on May 29, 2024, 11:05 a.m.