Skip to content

splineDensity Rpackage: Density estimation with smoothing B-spline

Notifications You must be signed in to change notification settings

fpavone/pacs_spline_density

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

splineDensity Package R logo

Course on Advanced programming for scientific computing

Politecnico di Milano (ITALY)

Polimi logo

Author : Alessia Di Blasi, Federico Pavone, Gianluca Zeni

Mailto : [email protected], [email protected], [email protected]

Date : September 2018

The output is an R Package [splineDensity]

The source code is written in C++ and linked to R throught the API RcppEigen and .Call

Subfolder structure

  • src contains all C++ code and a special file named Makevars necessary to build and install the R package
  • R contains the R functions that wrap the C++ calls
  • data contains all .rda and .RData files useful for testings
  • tests contains basic R script to run tests

To install the package, please make sure that you have the package devtools already installed.

If your compiler supports openMP parallelization modify the Makevars with a non-empty value for the OPENMP macro (default disabled).

From the root folder then type

R -e "library(devtools); install()" —-silent
R -e "library(devtools); document()" —-silent

or in another way download source code from the github repository, unzip the file and run from the terminal:

R CMD INSTALL <path name of the package to be installed> -l <path name of the R library tree>

Otherwise you can install directly from github:

devtools::install_github("fpavone/pacs_spline_density", ref = "master")

Be careful that this will not allow you to compile with enabled parallelization.

To run an example in R:

example(smoothSplines)