What is the readBin() Function in R

readBin in R - How to Read Binary Data 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

atan2() Function in R with Example

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

How to Use the diff() Function in R

diff() Function in R with Example

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

log10 in R: How to Use log10() Function in R Language

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)

R Ceiling - How to Calculate Ceiling of Number in R

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

R atan() Function with Example

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

chol() Function in R with Example

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

R agrep() Function - How to Match Patterns in R String

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

col() Function in R with Example

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