Skip to content

Knitr Engine That Passes R Arrays to Octave

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

zandergordan/octave.connect

Repository files navigation

octave.connect

This package defines a knitr engine that connects to Octave and passes it a command defining an array based on an R array.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("zandergordan/octave.connect")

Example

Here is a basic example of using the package. First, anywhere in your rmarkdown file (typically in the setup) chunk:

library(octave.connect)
octave_connect("C:\\Users\\alexander.gordan\\AppData\\Local\\Programs\\GNU Octave\\Octave-6.1.0\\mingw64\\bin\\octave")

Then, define an R array:

example_array <- array(data = 1:16, dim = c(4,4))
example_array
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    5    9   13
#> [2,]    2    6   10   14
#> [3,]    3    7   11   15
#> [4,]    4    8   12   16

And now we can use an octave_connect chunk to do things with the array in Octave (to view the full syntax, look at README.rmd instead of the rendered README.md):

sum(example_array)
#> ans =
#> 
#>    10   26   42   58

About

Knitr Engine That Passes R Arrays to Octave

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages