head() function in R is one of the most useful functions that lets you quickly get a peek at the data you have in a R object. Using head() function in R, you can view the first elements in a vector, matrix, dataframe and other R objects. In this tutorial, we will use head() … [Read more...] about head() in R to view the first elements
How to find installed R version from RStudio
In this tutorial, you will learn three different ways to identify the version of R installed in your computer. Find R version from console after opening RStudio One of the ways to find the R version that you are using is to look at the console when you open R either using … [Read more...] about How to find installed R version from RStudio
gsub() in R to replace all matching patterns
In this tutorial, we will learn about gsub() function in R to replace all matching patterns in a string. gsub, stands for "global substitution" is similar to another function R, sub(), but for substituting all matching patterns, not just the first one. Here is a typical use of … [Read more...] about gsub() in R to replace all matching patterns
dplyr near(): compare if numbers and vectors are nearly the same
In this tutorial, we will learn near() function part of R package dplyr to check the equality of two numbers or vectors. Often we would like to compare if two numbers or two vectors are equal. A naive approach of using == to compare if two numbers are equal can be problematic due … [Read more...] about dplyr near(): compare if numbers and vectors are nearly the same
How to Save Dataframe into XLSX file in R
In R, there are many ways to save a dataframe as Excel file *.xlsx. In this tutorial, we will use the R package openxlsx and learn how to save a dataframe as xlsx file. First we will learn how to save a xlsx file using write.xlsx() function in openxlsx package. And then we will … [Read more...] about How to Save Dataframe into XLSX file in R