In this tutorial, we will learn how to compute correlation between two numerical variables in R using cor() function available in base R. Correlation between two numerical variables can range from -1 to +1, where -ve values suggest these two variables negatively correlated … [Read more...] about Computing Correlation with R
R Function
seq() function to create sequences
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
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
How to create a directory if it does not exist in R
In this tutorial we will learn how to create a directory if it does not exist already using R. We will be using two base R functions, one of checking if a directory exists and the other for creating a directory. If a directory exists already we would not be creating it and if … [Read more...] about How to create a directory if it does not exist in R
dplyr ends_with(): select columns that end with a suffix
In this tutorial, we will learn how to select columns that ends with a string with multiple examples using dplyr and base R. With dplyr, we can use ends_with(), one of the select helper functions, to select columns that ends with a prefix/string. Similarly, in base R we have … [Read more...] about dplyr ends_with(): select columns that end with a suffix