|
R works on the
principle of ‘functions’ and objects. Functions are statements that
accomplish a task (say you have a function for calculating the mean of x so
that it will state mean(x) = sum(x)/length(x) where mean() is a function,
sum is a function, and length is a function. Functions are denoted by ().
Whatever goes in between the parentheses are arguments, so in the above
examples, x is an argument to the function mean, or sum, or length. R is
also very object oriented, in that, all entities in R are objects. Thus, if
we specify meanx <- mean(x), we indicate that meanx is an object that takes
the value of mean of x, as denoted by the function mean(x). Every object has
its own properties, that can be explored by other functions.
|