R/add_matlab_path.R

Defines functions add_matlab_path

Documented in add_matlab_path

#' A wrapper for `Octave's` `addpath` to add `matlab` folder.
#'
#' Use this function to add `matlab` folder.
#' Use this function if `Dynare` is **NOT** installed in the standard location
#' @param matlab_path Path to the `matlab` folder. Default `path` is `/usr/lib/dynare/matlab` for `Linux`, `/usr/lib/dynare/matlab` for `macOS` and `c:/dynare/x.y/matlab` for `Windows`, where x.y is `Dynare` version number.
#' @return Set of \code{Dynare} (open-source software for DSGE modelling) outputs
#' @examples library(DynareR)
#' \dontrun{
#' add_matlab_path('/usr/lib/dynare/matlab') #  Default for Linux
#'
#' add_matlab_path('c:/dynare/5.1/matlab') # Default for Windows, but 5.1 can change
#' # if later version of `Dynare` is installed.
#'
#' add_matlab_path('/usr/lib/dynare/matlab') # Default for macOS
#'
#'}
#' @family important functions
#' @keywords documentation
#' @export
add_matlab_path <- function(matlab_path) if(dir.exists(matlab_path) && endsWith(matlab_path,"matlab")) matlabPath<<-paste('addpath',matlab_path) else stop(paste0("'",matlab_path,"' is not a valid directory or does not end with 'matlab'"))

Try the DynareR package in your browser

Any scripts or data that you put into this service are public.

DynareR documentation built on Oct. 1, 2023, 1:08 a.m.