R programming - Mathematical functions in R #rprogramming

preview_player
Показать описание
R programming Section 4. Advanced data management. Lecture 1. Mathematical functions in R.

common mathematical functions, most of them can work on both scalar, vector, matrix and data frames
abs(Y) Absolute value
Example: abs(-5.0) returns 5
sqrt(Y) Square root
Example: sqrt(c(25, 16)) returns a vector of (5, 4)
ceiling(Y) Smallest integer not less than Y
Example: ceiling(5.5) returns 6
floor(Y) Largest integer not greater than Y
Example: floor(-2.3) returns -3
trunc(Y) Integer formed by truncating decimal part in Y
Example: trunc(-3.6) returns -3
round(Y, digits=n) Rounds Y to the specified number of decimal places
Example: round(15.3456, digits=2) returns 15.35
log(Y) natural logarithm
Example: log(10) returns 2.302585
exp(Y) Exponential function
Example: exp(2.3085) returns 10.06

#rprogramming
#rstudio
#mathematical
#function
#rdatacode
Рекомендации по теме
join shbcf.ru