seq() function in R is one of the base R functions that is useful in creating sequences. In this tutorial, we will see multiple examples of creating sequence of numbers using seq() function. FIrst let us start with the simplest example of using seq() function. If you give a … [Read more...] about seq() function to create sequences
dplyr contains(): select columns that contains a string
In this tutorial, we will learn how to select columns, whose names contains a string using dplyr's contains() function. dplyr's contains() function belongs to a family helper functions to select columns like starts_with() and ends_with(). First we will see a simple example of … [Read more...] about dplyr contains(): select columns that contains a string
dplyr transmute(): add new columns and delete existing columns
In this tutorial, we will learn how to create new columns and remove existing columns using dplyr's transmute() function. We will start with an example showing how to use transmute to create one new column and then show an example of creating more than one new column. First, … [Read more...] about dplyr transmute(): add new columns and delete existing columns
dplyr’s mutate(): How to create new columns
In this tutorial, we will learn how to create/add one or more columns to a dataframe using dplyr's mutate() function. We will first see an example of creating a single new column in a dataframe and then see an example of adding multiple columns using mutate() function. First … [Read more...] about dplyr’s mutate(): How to create new columns
How to Generate Random Numbers from Uniform Distribution
In this tutorial, we will learn how to simulate or generate random numbers from uniform distribution. In R, with the in-built function runif() we can generate uniform random numbers. The basic usage of runif() function looks like this where n refers to the number of … [Read more...] about How to Generate Random Numbers from Uniform Distribution