Andrew's ExaStat Notes

This page holds notes on how to port R code into ExaStat, for the purposes of compiling and speeding up run times.

Declarations

Since ExaStat is C++ based, we must declare our variables. I recommend “Hungarian notation” in order to keep things easily readable - that is, make the first letter of your variable refer to the type.

These are traditional C++ variable types:

int iCount; // Comments are made like this... float fScore; /* or like this */ long iLongCount;

Matrices and Vectors

In R, objects were vectors by default. Here you must declare them using special types:

IntVar iRobot; FloatVar fDamage;

These types are also Classes in their own right, with built-in functions to accomplish particular tasks:

iStandings.Sum() iRobot.Mean()

Reading Files
Random Number Generation

CSV files are easy to read.

DataSet ds = ReadTextFile (”thing.csv”)

is as in R

tab ← read.csv(”thing.csv”)

though I don’t yet know about headers.


strcat_s(outputstr,addonstr)

 
exastatnotes.txt · Last modified: 2006/11/03 15:30 by athomas
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki