How to convert a matrix to a tidy table

In this tutorial, we will learn how to convert a data matrix to tidy long table. We will use tidyr’s pivot_longer() function to reshape the matrix into a tidy table. First, let us start with loading the tidyverse suit of packages. Create a simulated data matrix Let us create a data matrix using rnorm() function… Continue reading How to convert a matrix to a tidy table

pivot_longer on dataframe with single row

In this tutorial, we will see an example of using pivot_longer() function to reshape, a dataframe with a single row, from wide form to long tidy form. Sometimes you might have a dataframe with just one long row and it is useful to reshape into longer format. We will start with creating a dataframe with… Continue reading pivot_longer on dataframe with single row

Exit mobile version