prev next front |1 |2 |3 |4 |5 |6 |7 |8 |9 |10 |11 |12 |13 |14 |15 |16 |17 |18 |19 |20 |21 |22 |23 |24 |25 |26 |27 |28 |29 |30 |31 |32 |33 |review
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.