rep Function in R: How to Replicate Values of Vector

R rep() Function with Example

The rep() is an iteration function in R. The term iteration means repetition.  An iteration is a core aspect of R. The regular loops like for loop, and while loop is costly in time and memory management. The rep() is a good vectorized alternative method whose goal is to achieve iteration. Vectorized methods operate on … Read more

sprintf in R: How to Print Formatted String in R

sprintf() Function in R with Example

R provides the sprintf() function that provides string formatting as the same C language. To be more specific, the sprintf() method is a wrapper for the C library method of the same name. sprintf() in R The sprintf() is a built-in R function that returns a character vector containing the formatted combination of text and … Read more

strsplit in R: How to Split String in R with Delimiter

Strsplit R - How to Split String in R using strsplit() Function

The string is a collection of combined letters and words. String manipulation is a common operation in R programming. concatenation, splitting, and joining are common operations we need to perform on the string. strsplit() in R The strsplit() is a built-in R function that splits the string vector into sub-strings. The strsplit() method returns the … Read more

grepl in R: How to Use grepl() Function in R

grepl in R - How to Use grepl() Function in R

We often come across a functionality where we want to check something by comparing it with patten. We use a regular expression to match certain character vectors in the string. Let’s see how to use regular expression in R. grepl in R The grepl() is a built-in function that searches for matches of a string … Read more

charmatch in R: How to Do Partial String Matching in R

charmatch in R - How to Do Partial String Matching in R

The charmatch() function attempts to match the elements of its first argument among those of its second. charmatch in R The charmatch() is a built-in R function that finds matches between two arguments. To do a Partial String Matching in R, use the charmatch() function. The charmatch() function accepts three arguments and returns the integer … Read more

char.expand in R: How to Find Unique Match of Elements

char.expand in R - How to Find Unique Match of Elements

The char.expand() method is especially useful when abbreviations are allowed in function arguments and need to be uniquely expanded with respect to a target table of possible values. char.expand in R The char.expand() is a built-in function that seeks a unique match of its first argument among the elements of its second. If successful, it returns … Read more

Infinity in R: How to Handle Infinity in R

R Infinity - How to Handle Infinity in R

Infinity is the concept of something unlimited, endless, without boundary in mathematics. In math, infinity is a concept that refers to an endless quantity that’s larger than every real number. Infinity can appear if you divide any number by 0 in mathematics. Types of Infinity in R There are two types of infinity in R. Positive … Read more