• 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

dplyr

Compute rowwise mean and standard deviation

rstats101 · September 16, 2023 ·

In this post, we will learn how to compute row-wise summary statistics like mean and standard deviation using dplyr's row_wise() function. First, let us load tidyverse and verify the version of dplyr. Let us create a toy dataframe with five columns. We use sample() … [Read more...] about Compute rowwise mean and standard deviation

Filed Under: dplyr, dplyr rowwise(), rstats101 Tagged With: compute rowwise mean and sd

How to apply a function on multiple columns using across()

rstats101 · September 9, 2023 ·

In this post, we will learn how to compute one or multiple functions on multiple columns using dplyr's across() function. dplyr's across() function can be used with summarize() or mutate() functions to operate on columns. In this example we will use summarize() function to … [Read more...] about How to apply a function on multiple columns using across()

Filed Under: dplyr, dplyr across(), rstats101 Tagged With: apply a function on multiple columns, dplyr across() with summarize

How to remove rows with all NAs

rstats101 · August 29, 2023 ·

Remove rows with all NAs

In this tutorial, we will learn how to remove rows with all values are NAs using dplyr in tidyverse. For example in the cartoon illustration below we have a dataframe with three rows and two of the rows has NAs for all elements. We will learn how to filter out the rows with all … [Read more...] about How to remove rows with all NAs

Filed Under: dplyr if_any Tagged With: remove rows with all NAs

How to Change Column Name with a variable name

rstats101 · July 15, 2023 ·

In this post we will learn how to rename a column name in a dataframe with another name saved in a variable using dplyr. We will use dplyr's rename() function in combination with special functions that are part of tidyverse's tidy eval functionalities. First, let us load … [Read more...] about How to Change Column Name with a variable name

Filed Under: dplyr rename(), rstats101 Tagged With: rename column with a variable

dplyr case_when() to create new variable using multiple conditions

rstats101 · March 17, 2023 ·

In this tutorial, we will learn how to use dplyr's case_when() function to create a new variable based on multiple conditions. dplyr's case_when() function offers a genereal solution when you might needed multiple if_else() conditions. In this blog post, we’ll explore … [Read more...] about dplyr case_when() to create new variable using multiple conditions

Filed Under: dplyr case_when(), rstats101 Tagged With: dplyr case_when() default, dplyr case_when() with NAs

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Interim pages omitted …
  • Page 9
  • 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