• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Rstats 101

Learn R Programming Tips & Tricks for Statistics and Data Science

  • Home
  • About
    • Privacy Policy
  • Show Search
Hide Search

How to calculate cumulative sum in R

rstats101 · December 6, 2022 ·

cumulative sum in R

In this tutorial, we will learn how to calculate cumulative sum in R. With cumsum() function in base R, we. can compute cumulative sum of a vector in R. We will first see two examples of using cumsum() on a vector to compute cumulative sum and then we will compute cumulative … [Read more...] about How to calculate cumulative sum in R

Filed Under: rstats101 Tagged With: cumulative sum in R

dplyr rename(): How to rename column in r with dplyr

rstats101 · December 3, 2022 ·

How to rename a column with dplyr's rename()

In this tutorial, we will learn how to rename column name of a dataframe in R using dplyr's rename() function. We will first see the basic syntax to use to change the name of a column with dplyr's rename(). Then we will see an example of of changing one column name and next wee … [Read more...] about dplyr rename(): How to rename column in r with dplyr

Filed Under: rstats101 Tagged With: dplyr rename(), rename column with dplyr, rename columns in R

How to convert a matrix to a tidy table

rstats101 · December 1, 2022 ·

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 … [Read more...] about How to convert a matrix to a tidy table

Filed Under: pivot_longer() Tagged With: reshape matrix to tidy table, tidyr pivot_longer()

How to Convert Numerical Variable into a Categorical Variable in R

rstats101 · November 23, 2022 ·

In this tutorial, we will learn how to convert numerical or continuous variable into categorical variable. We will start with the simple example converting a numerical variable into a categorical variable with just two levels. And then we will see an example of converting a … [Read more...] about How to Convert Numerical Variable into a Categorical Variable in R

Filed Under: rstats101 Tagged With: numerical variable to categorical

How to sort columns alphabetically

rstats101 · November 17, 2022 ·

In this tutorial, we will learn how to sort columns of a dataframe in alphabetical order. We will first use tidyverse to sort columns of a dataframe using two different ways. And then we will see how to use base R functions to sort the columns. Let us load … [Read more...] about How to sort columns alphabetically

Filed Under: tidyselect, tidyverse Tagged With: sort columns of a dataframe

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 9
  • Page 10
  • Page 11
  • Page 12
  • Page 13
  • Interim pages omitted …
  • Page 24
  • Go to Next Page »

Primary Sidebar

Recent Posts

  • How to create a nested dataframe with lists
  • How to compute proportion with tidyverse
  • How to Compute Z-Score of Multiple Columns
  • How to drop unused level of factor variable in R
  • How to compute Z-score

Categories

%in% arrange() as.data.frame as_tibble built-in data R colSums() R cor() in R data.frame dplyr dplyr across() dplyr group_by() dplyr rename() dplyr rowwise() dplyr row_number() dplyr select() dplyr slice_max() dplyr slice_sample() drop_na R duplicated() gsub head() impute with mean values is.element() linear regression matrix() function na.omit R NAs in R near() R openxlsx pivot_longer() prod() R.version replace NA replace NAs tidyverse R Function rstats rstats101 R version scale() sessionInfo() t.test() tidyr tidyselect tidyverse write.xlsx

Copyright © 2025 · Daily Dish Pro on Genesis Framework · WordPress · Log in

Go to mobile version