tp2-vignette

Alexey Larionov

04 Apr 2022

This vignette explains how to use tp2 package

Summary

This is the very detailed description of my tp2 package, similar to academic paper, as expected by R community for Vignette:

https://r-pkgs.org/vignettes.html

Load package

library(tp2)

Reading package data


x <- v
y <- m

x
#> [1] 1 2 3 4 5
y
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    1    6   11   16   21
#> [2,]    2    7   12   17   22
#> [3,]    3    8   13   18   23
#> [4,]    4    9   14   19   24
#> [5,]    5   10   15   20   25

Using package functions


dot_product(x,y)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]   55  130  205  280  355

dot_product(y,x)
#>      [,1]
#> [1,]  215
#> [2,]  230
#> [3,]  245
#> [4,]  260
#> [5,]  275

product_by_element(x,y)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    1    6   11   16   21
#> [2,]    4   14   24   34   44
#> [3,]    9   24   39   54   69
#> [4,]   16   36   56   76   96
#> [5,]   25   50   75  100  125

More Flowers

Vignette has bigger flowers than in README.md !

Path to image should be relative to Rmd file

flowers A better way of showing graphics in Rmd :

knitr::include_graphics("../inst/big_flowers.png")