## What is the readBin() Function in R

The readBin() function in R is “used to read binary data from a connection or raw vector”.  Syntax readBin(con, what, n = 1L, size = NA_integer_, signed = TRUE, endian = .Platform\$endian) Parameters con: It is a connection object or a character string naming a file or a raw vector. what: It is either an object … Read more

## How to Use the atan2() Function in R

The atan2(y, x) function in R is “used to return the radian arctangent between the x-axis and the vector from the origin to (x, y)”. Syntax atan2(y, x) Parameters y: It is a Raster* object. x: It is a Raster* object. Return value It returns the radian arctangent. Example 1: How to use the atan2() … Read more

## What is the asinh() Function in R (4 Examples)

The asinh() function in R is “used to calculate the inverse hyperbolic sine of a value.” Formula The inverse hyperbolic sine of x is defined as: where e is an Euler’s number. In special cases, it returns the following: If the argument is NaN, then the output is NaN. If the argument is infinite, the … Read more

## How to Use the diff() Function in R

The diff() function in R is “used to calculate the difference between pairs of consecutive elements of a numeric vector”. Syntax diff(x, lag = 1, differences = 1) Parameters x: It is a numeric vector containing the values to be differenced. lag: It is an integer indicating which lag to use. differences: It is an … Read more

## How to Use log10() Function in R

The log10() function in R “is used to calculate the base-10 logarithm of a given number”. For example, log10(100) returns 2. Syntax log10(num) Parameters num: It is a number argument whose logarithm base 10 must be calculated, and it must be greater than zero. Return value The log10() function uses “base 10 to return the … Read more

## How to Use ceiling() Function in R (5 Examples)

The ceiling() function in R is “used to return the smallest integer value, greater than or equal to a specific number, or an expression”. For example, ceiling(3.14) returns 4. Syntax  ceiling(x) Parameters The ceiling() function accepts one parameter whose value needs to be rounded off. If the x parameter is a positive or negative numeric … Read more

## What is the atan() Function in R

The atan()function in R is “used to return inverse tangent value of a numeric value”. For example, atan(1) returns 0.7853982 radians. Syntax atan(number) Parameters number: It’s a number as a numeric value. Return value The atan() function returns the inverse tangent of a number (radians) sent as a parameter. It is between [-pi/2,pi/2] in radians. … Read more

## What is the Cholesky Decomposition in R

The Cholesky decomposition is a method of decomposing a positive-definite matrix into the product of a lower triangular matrix and its transpose. The chol() function in R is “used to perform Cholesky decomposition on a positive-definite matrix”. Syntax chol(x, pivot = FALSE, LINPACK = FALSE, tol = -1, …) Parameters x: It is an object … Read more

## How to Use the agrep() Function in R

The agrep() function in R is “used to search for approximate matches to pattern within each element of the provided input string”. Syntax agrep(pattern, x, ignore.case = FALSE, value = FALSE) Parameters pattern: A specified pattern that will be matched with given string elements. x: Specified string vector. ignore.case: If its value is TRUE, it ignores … Read more

## How to Use col() Function in R

The col() function in R is “used to get a matrix which contains the number of columns of the matrix“. Syntax col(x, dim, as.factor = FALSE) Parameters x: It is a matrix-like object with a two-dimensional dim. dim: It is a matrix dimension, i.e., an integer-valued numeric vector of length two (non-negative entries). as.factor: It is … Read more