Krunal Lathiya

How to Remove the First Row of DataFrame in R

Here are three ways to remove the first row of a data frame in R: Using negative indexing Using dplyr::slice()…

12 months ago

R basename() Function

The basename() is a base R function that extracts the last component (or the 'base name') of a file or…

12 months ago

How to Append an Element to a List at Any Position in R

To grow the list, you can add an element (numeric value, character vectors, other lists, data frames, or functions) at…

12 months ago

How to Remove Duplicates from a Vector in R

In R, unique() and subsetting with !duplicated() are efficient ways to remove duplicates. Duplicate elements in a vector refer to…

12 months ago

How to Remove Single or Multiple Rows from Data Frame in R

The best and most efficient way to remove rows from a data frame is using "negative indexing". It is a…

1 year ago

How to Transpose Data Frame in R

Transposing means switching rows to columns and columns to rows. It is a common operation in the matrix.  The above…

1 year ago

How to Select Rows by Single or Multiple Conditions in R

Here are the two most prominent ways to select rows by single or multiple conditions in R: Subsetting with […

1 year ago

R length() Function: Vector, List, Matrix, Array, Data Frame, String

The length() function sets or gets the length of vectors or any other R object. vec <- 1:5 cat("The length…

1 year ago

How to Round Numbers in R

Here are five ways to round numbers in R: Using round() Using signif() Using ceiling() Using floor() Using trunc() Rounding…

1 year ago

Adding Single or Multiple Columns to Data Frame in R

Here are the five ways to add single or multiple columns to a data frame in R: Using $ operator Using…

1 year ago