• 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

tidyr

How to create a nested dataframe with lists

rstats101 · November 27, 2024 ·

In this tutorial, we will learn how to create a nested dataframe using nest() function in tidyverse. A nested dataframe is a dataframe where one or more columns are list columns. In a simple dataframe, columns are simple/atomic vectors. However, column can contain other data … [Read more...] about How to create a nested dataframe with lists

Filed Under: rstats101, tidyr, tidyr unnest() Tagged With: nested dataframe with list

expand_grid(): Create all possible combinations of variables

rstats101 · August 26, 2024 ·

In this tutorial, we will learn how to create all possible combinations of two variables using tidyr's expand_grid() function. For example, if we have two variables of interest and want to create a dataframe with all possible combinations of the values of the two variables, we … [Read more...] about expand_grid(): Create all possible combinations of variables

Filed Under: tidyr, tidyr expand_grid() Tagged With: all combinations of inputs

tidyr’s separate_delim_wider(): Split a string into columns

rstats101 · July 3, 2024 ·

In this tutorial, we will learn how to split a string in a column into multiple columns using a delimiter. We will use tidyr's separate_delim_wider() function, that separates a string in a column into multiple columns using delimiter. After spliting the dataframe is wider with … [Read more...] about tidyr’s separate_delim_wider(): Split a string into columns

Filed Under: tidyr, tidyr separate_delim_wider() Tagged With: separate a column into multiple columns

How to replace NAs with zero in a dataframe

rstats101 · February 17, 2023 ·

In this post we will learn how to replace NAs, i.e. missing values with zeros in data frame in R. With tidyr's replace_na() function, we can replace NAs in specific columns of a dataframe to zero or any other specific value. We will start with learning how to use replace_na() … [Read more...] about How to replace NAs with zero in a dataframe

Filed Under: rstats101, tidyr replace_na() Tagged With: replace NAs with specific values, replace NAs with zeros

tidyr unite(): combine multiple columns into one

rstats101 · January 20, 2023 ·

In this tutorial, we will learn how to use unite() function in tidyr package to combine multiple columns into a single column. By combining , we mean to concatenate the values of two or more columns separated by a delimiter like underscore. We will start with combining two … [Read more...] about tidyr unite(): combine multiple columns into one

Filed Under: tidyr, tidyr unite() Tagged With: combine multiple columns into one

  • 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