• 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

How to add Prefix/Suffix to Column Names of a dataframe in R

rstats101 · January 11, 2023 ·

In this tutorial we will learn how to add a prefix or a suffix to column names of a data frame in R. We will use dplyr's rename_with() function to add prefix/suffix to column names. dplyr's rename_with() function belongs to another renaming function in dplyr, rename() that is … [Read more...] about How to add Prefix/Suffix to Column Names of a dataframe in R

Filed Under: dplyr, dplyr rename_with(), rstats101 Tagged With: add prefix to column names, add prefix/suffix to select column names, add suffix to column names

dplyr arrange: Sort rows by one or more variables

rstats101 · January 5, 2023 ·

dplyr arrange(): Sort by multiple columns example

In this tutorial, we will learn how to sort a dataframe by one or more columns using dplyr's arrange() function. dplyr's arrange() function is one of the important functions in dplyr that lets you use dplyr to sort rows. By sorting, we mean dplyr's arrange() changes the order … [Read more...] about dplyr arrange: Sort rows by one or more variables

Filed Under: dplyr arrange(), rstats101 Tagged With: dplyr sort by a column, dplyr sort by multiple columns

dplyr across(): Compute column-wise mean

rstats101 · October 29, 2022 ·

In this tutorial, we will learn how to use dplyr's across() function to compute means of all columns in a dataframe. In R, we can use many approaches to compute column means. Here we will use tidyverse approach using dplyr's across() function to compute column wise means. We … [Read more...] about dplyr across(): Compute column-wise mean

Filed Under: dplyr, dplyr across() Tagged With: column-wise mean, dplyr across() column-wise

How to remove columns with all NAs

rstats101 · October 14, 2022 ·

Learn to remove columns with all NAs using two approaches

In this tutorial, we will learn how to drop columns with values that are all NAs. We will use two approaches to remove columns with all NAs. First, we will use tidyverse approach, where we perform column-wise operation to see all values are NAs and select columns that are not all … [Read more...] about How to remove columns with all NAs

Filed Under: apply(), dplyr select() Tagged With: remove columns with all NAs

How to count number of missing values per row in a dataframe

rstats101 · October 13, 2022 ·

Count the number of missing values per row

In this tutorial, we will learn how to count the number missing values, NAs, in each row of a dataframe in R. We will see examples of counting NAs per row using four different approaches. For the first two solutions, we will use tidyverse function rowwise() from dplyr. The next … [Read more...] about How to count number of missing values per row in a dataframe

Filed Under: dplyr rowwise() Tagged With: count NAs per row

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Page 6
  • 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