• 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

tidyverse

How to drop unused level of factor variable in R

rstats101 · October 8, 2024 ·

In this post, we will learn how to drop unused level or levels of a factor variable in R. Sometimes, we may end up with a factor variable with un used levels after some data munging. Unused factor levels can sometime create issues while analyzing the data. In this tutorial, … [Read more...] about How to drop unused level of factor variable in R

Filed Under: droplevels(), forcats fct_drop() Tagged With: drop unused levels of factor

T-test on real data using tidyverse

rstats101 · August 28, 2024 ·

In this post, we will learn how to perform t-test on a real dataset and use tidyverse framework to access results from t-test. Check out the post how to do t-test to learn base R approach to t-tes. We will use Palmer penguin dataset, a real world dataset, to show how to … [Read more...] about T-test on real data using tidyverse

Filed Under: rstats101, t.test(), tidyverse Tagged With: t-test with tidyverse

How to convert a list to a dataframe

rstats101 · August 23, 2024 ·

In this tutorial, we will learn 3 different ways to convert a list object into a dataframe in R. First we will show how to use the base R function as.data.frame() to convert a list to a dataframe. Then we will show examples using map_df() function in purrr package in tidyverse … [Read more...] about How to convert a list to a dataframe

Filed Under: as.data.frame, dplyr bind_rows(), map_df, rstats101 Tagged With: convert list to dataframe

How to add currency symbols to columns of a table with gt()

rstats101 · July 31, 2024 ·

Currency symbol in a table with gt()

In this tutorial, we will learn how to add currency symbols, like US dollars, Euro, UK pound, Indian Rupee to columns of a table using the R package gt. Let us load gt package to make beautiful tables and tidyverse. First we will create a simple dataframe/tibble with … [Read more...] about How to add currency symbols to columns of a table with gt()

Filed Under: gt table Tagged With: add currency symbol to table, add US dollar symbol to table

How to sort columns alphabetically

rstats101 · November 17, 2022 ·

In this tutorial, we will learn how to sort columns of a dataframe in alphabetical order. We will first use tidyverse to sort columns of a dataframe using two different ways. And then we will see how to use base R functions to sort the columns. Let us load … [Read more...] about How to sort columns alphabetically

Filed Under: tidyselect, tidyverse Tagged With: sort columns of a dataframe

  • Page 1
  • Page 2
  • 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