Homepage > MCMC

Explore MCMC with R

R is a language and environment for statistical computing and graphics, and is available as free software. The system runs on Windows, Linux, and Mac, and can be downloaded from CRAN R project. Each ``command'' is executed in an interactive manner, known as ``interpretor,'' and is requested in a form of ``function,'' for example, it is a function demo(graphics) to show a demonstration of R graphics.

> demo("graphics")

Executing an external file. A script file (usually with extension ".r" or ".R") can be prepared as an external file, and executed in R with the command

> source("[script filename]")
Programming note. Your external file must be found in the working directory to be recognized from R. You can always change the working directory from R via [File]->[Change dir...]. Alternatively you can set the working directory by
> setwd("[pathname]")

© TTU Mathematics