• 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

dplyr count(): count unique values of a variable

rstats101 · January 26, 2022 ·

In this tutorial, we will learn how to count unique values of a variable(s) or column using dplyr's count() function. dplyr's count() function is a convenient function that combines grouping operation and counting the number of observation in each group. We will learn of 4 … [Read more...] about dplyr count(): count unique values of a variable

Filed Under: dplyr count() Tagged With: Count unique values of a variable, dplyr count unique values

How to randomly select rows from a dataframe in R

rstats101 · January 25, 2022 ·

How to randomly select rows from a dataframe in R

In this tutorial, we will learn how to randomly select rows from a dataframe using dplyr's slice_sample() function in R. slice_sample() is the new way to randomly select rows either with replacement or without replacement and it supersedes an earlier function sample_n() in … [Read more...] about How to randomly select rows from a dataframe in R

Filed Under: dplyr slice_sample() Tagged With: randomly sample rows in R, randomly select rows from a dataframe

dplyr row_number(): Add unique row number to a dataframe

rstats101 · January 23, 2022 ·

How to add row number to a dataframe in R

In this tutorial, we will learn how to add unique row number to each row to a dataframe/tibble. We will use dply'r row_number() function to add unique row number as acolumn to a dataframe using tidyverse first. Then we will also see an example of adding a row number to a … [Read more...] about dplyr row_number(): Add unique row number to a dataframe

Filed Under: dplyr row_number() Tagged With: dplyr add row number

dplyr near(): compare if numbers and vectors are nearly the same

rstats101 · December 15, 2021 ·

In this tutorial, we will learn near() function part of R package dplyr to check the equality of two numbers or vectors. Often we would like to compare if two numbers or two vectors are equal. A naive approach of using == to compare if two numbers are equal can be problematic due … [Read more...] about dplyr near(): compare if numbers and vectors are nearly the same

Filed Under: dplyr, near() R Tagged With: check if nearly equal in R

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 7
  • Page 8
  • Page 9

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