*Data Expressions*

*Data Expressions*

The following list defines data expressions in R that are used to compute basic numerical results for scalars, vectors, and rectangular data objects. Scroll through the table to see all functions:

Function | Description | Comment |
---|---|---|

abs() | Absolute value | n/a |

approx() | Linear interpolation of points | n/a |

asin(); acos(); atan() | Inverse trigonometric functions | n/a |

asinh(); acosh(); atanh() | Inverse hyperbolic functions | n/a |

ceiling() | Round up to nearest integer | Impacts stored precision |

colmeans(); colsums(); colvar(); colstds() | Summary stats by column | n/a |

cor() | Returns the correlation matrix of a data matrix | n/a |

cumprod() | Cumulative product | by column |

cumsum() | Cumulative sum | by column |

diff() | Element-by-element subtraction | (n+1) - n by column; diff(x, lag = 2) |

exp() | Exponential | n/a |

factorial() | Compute n! | n/a |

floor() | Rounds down to the nearest integer | Impacts stored precision |

gamma(); lgamma(); digamma() | Gamma function and its natural log | gamma(x) = (x-1)! |

kurtosis() | Kurtosis of a vector | n/a |

log() | Natural logarithm base e | n/a |

log10() | Common log base 10 | log10(x) == log(x, base = 10) |

max(); mean(); min(); median() | Distribution summary statistics | n/a |

prod() | Product of all the elements | n/a |

range() | Minimum and maximum | n/a |

rev() | Sort in reverse or descending order | n/a |

round() | Rounds to the specified number of digits | default = 0; round(x, digits = 3) |

rowmeans(); rowsums(); rowvar(); rowstds() | Summary statistics by row | n/a |

scale() | Centers data to have mean zero and unit variance | n/a |

skewness() | Skewness of a vector | n/a |

signif() | Rounds to the specified number of significant digits | n/a |

sin(); cos(); tan() | Trigonometric functions | Radians |

sinh(); cosh(); tanh() | Hyperbolic functions | n/a |

sqrt() | Square root | n/a |

sd() | Standard deviation | n/a |

sum() | Sum of all values | n/a |

summary() | Min, max, 1st and 3rd quartiles, mean and median | n/a |

union() | Union of sets | n/a |

trunk() | Returns the integer part of any element | n/a |

var() | Variance of a vector or the variance/covariance of a matrix | n/a |