knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

mypkgr

The goal of mypkgr is to calculate values of multivariate gaussian density and learning how to build R package.

Installation

You can install the development version of mypkgr from GitHub with:

# install.packages("devtools")
devtools::install_github("Florian-40/mypkgr")

Example

This is a basic example which shows you how to solve a common problem:

Univariate density

library(mypkgr)
mvnpdf(x=matrix(c(1.96,-0.5), ncol=2), Log=FALSE)

Bivariate density

mvnpdf(x=matrix(rep(1.96,2),nrow=2, ncol=1),Log=FALSE)

Graphical representation.

pdfvalues <- mvnpdf(x=matrix(seq(-3,3, by=0.1), nrow=1), Log=FALSE)
plot(pdfvalues)

C++functions.

To use C++ function, we use the code below :

Rcpp::sourceCpp("src/timesTwo.cpp")
timesTwo(12.5)

And for inversion matrix :

Rcpp::sourceCpp("src/invC.cpp")
A<-matrix(c(2,4,7,8,9,5,6,5,4), nrow=3, ncol=3)
invC(A)


Florian-40/mypkgr documentation built on April 30, 2022, 6:10 p.m.