• 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

Simple Barpots and reordering bars in R

rstats101 · September 17, 2023 ·

Reorder barplot by a variable using fct_reorder()

In this post, we will learn how to make simple barplot using ggplot2 and learn to reorder barplots in R. We will make a barplot using ggplot2's geom_col() with multiple bars. By default, ggplot2 orders the bars in alphabetical order. We will see examples of reordering barplots by … [Read more...] about Simple Barpots and reordering bars in R

Filed Under: rstats101 Tagged With: barplots in R, reorder barplots with reorder()

3 ways to rank numbers with tidyverse

rstats101 · September 16, 2023 ·

In this tutorial, we will learn 3 ways to rank integers in tidyverse. Tidyverse's dplyr has three integer ranking functions, row_number(), min_rank(), and dense_Rank(), inspired by SQL. And these integer ranking functions differ in how they handle ties. Let us jump into … [Read more...] about 3 ways to rank numbers with tidyverse

Filed Under: dplyr, dplyr dense_rank(), dplyr min_rank(), dplyr row_number(), rstats101 Tagged With: ranking integers

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

Simple linear regression with tidyverse

rstats101 · September 13, 2023 ·

clean lm() result object with broom

In this tutorial we will learn how to perform simple linear regression between two numerical variables in R using lm() function. The resulting object from a linear regression analysis using lm() is unwieldy and not intuitive for beginners. We use broom package that is part of … [Read more...] about Simple linear regression with tidyverse

Filed Under: broom, rstats101, tidymodels Tagged With: broom tidy(), simple linear regression and broom

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

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