by Erik Marsja | Oct 16, 2020 | Programming, R

In this R tutorial, you are going to learn how to add a column to a dataframe based on values in other columns. Specifically, you will learn to create a new column using the mutate() function from the package dplyr, along with some other useful functions. Finally, we...
by Erik Marsja | Oct 6, 2020 | Programming, R

In this tutorial, you will learn by examples how to use the %in% in R. Specifically, you will learn 7 different uses of this great operator. Outline Here’s the outline of this post, described a bit more detailed than the table of contents. First, we start out with a...
by Erik Marsja | Oct 2, 2020 | Programming, R

In this brief tutorial, you will learn how to transpose a dataframe or a matrix in R statistical programming environment. Transposing rows and columns is a quite simple task if your data is 2-dimensional (e.g., a matrix or a dataframe). If you have a, for example,...
by Erik Marsja | Sep 28, 2020 | Programming, R

In this R tutorial, you will learn how to generate sequences of numbers in R. There are many reasons why we would want to generate sequences of numbers. For example, we may want to generate sequences when plotting the axes of figures or simulating data. Outline...
by Erik Marsja | Aug 27, 2020 | Programming, R

In this R tutorial, you will learn how to extract year from datetime in R. You will learn by a couple of examples containing R code along with a description of the code. To know how to extract year from datetime may be needed when working with data containing datetime...
by Erik Marsja | Aug 25, 2020 | Programming, R

In this short R tutorial, you will learn how to add an empty column to a dataframe in R. Specifically, you will learn 1) to add an empty column using base R, 2) add an empty column using the add_column function from the package tibble and we are going to use a pipe...