• 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 add row number within each group in dplyr

rstats101 · June 3, 2022 ·

In this tutorial, we will learn how to add row numbers with in each group of a dataframe in R. We will use combination of group_by() and row_number() functions from dplyr to add row number by group. To get started let us load tidyverse and palmer penguin datasets. Here we … [Read more...] about How to add row number within each group in dplyr

Filed Under: dplyr, dplyr row_number() Tagged With: dplyr row number by group, dplyr row_number

How To find levels of a factor in R

rstats101 · May 31, 2022 ·

Factors are a type of variable that R uses to store categorical information in R. For example, we can save sexes as factor variable with two values male and female. In this post we will learn about using factor variables in R and learn how to find out about levels of a factor … [Read more...] about How To find levels of a factor in R

Filed Under: class() in R, str() in R Tagged With: factor levels in R, find levels of factor variable

How to select one or more columns from a dataframe

rstats101 · May 20, 2022 ·

In this tutorial we will learn how to select one or more columns/variables from a data frame in R. We first learn how to select the columns of interest with dplyr's select() function by using their name and then we will learn how to select columns using base R approach. Let … [Read more...] about How to select one or more columns from a dataframe

Filed Under: dplyr, dplyr select() Tagged With: select columns base R, select columns tidyverse

How to rename one or more columns of a dataframe

rstats101 · May 17, 2022 ·

In this tutorial, we will learn how to rename one or more columns of a dataframe in R. We will use rename() function in dplyr R package to change the name of a single column first and then see an example of using rename() function to rename more than one columns. Let us get … [Read more...] about How to rename one or more columns of a dataframe

Filed Under: dplyr, dplyr rename() Tagged With: rename columns in dplyr

How to select only numeric columns in a dataframe

rstats101 · May 12, 2022 ·

How to select all numerical columns from a dataframe

In this tutorial, we will learn how to select the columns that are numeric from a dataframe containing columns of different datatype. We will use dplyr's select() function in combination with where() and is.numeric() functions to select the numeric columns. Let us first load … [Read more...] about How to select only numeric columns in a dataframe

Filed Under: dplyr select() Tagged With: select numerical columns dplyr

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 16
  • Page 17
  • Page 18
  • Page 19
  • Page 20
  • 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