mfiles: M Files

Description Usage Arguments Examples

Description

as.mfile converts source code or .m filenames into real paths to .m files that can be sourced with o_source.

Usage

1
as.mfile(..., pattern = "mfile_", dir = tempdir())

Arguments

...

specification of a .m files as character arguments. The elements of the vector can be either file paths or plain Octave/Matlab code, which are then written to disk in – temporary – .m files. Note that the paths do not need to correspond to existing files.

pattern

a non-empty character vector giving the initial part of the name.

dir

existing directory where to write the .m files generated from the plain code elements of x.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
f <- as.mfile('test.m')
f

# detected code elements are written into temporary files
f <- as.mfile('test.m', "function [y] = myfun()
y = 1;
end
")

## Not run: 
file.show(f[2])

## End(Not run)

# remove all files
unlink(f)

renozao/RcppOctave documentation built on May 27, 2019, 5:52 a.m.