Top "Tidyr" questions

tidyr is an R package by Hadley Wickham for cleaning and reshaping data, designed to use the magrittr pipe (%>%) so as to interact well with dplyr and similar pipeable packages which emphasize tidy data.

How to control new variables' names after tidyr's spread?

I have a dataframe with panel structure: 2 observations for each unit from two years: library(tidyr) mydf <- data.…

r dplyr tidyr
Transposing data frames

Happy Weekends. I've been trying to replicate the results from this blog post in R. I am looking for a …

r reshape2 tidyr
Unable to install tidyr in R version 3.1.1

I am unable to install tidyr package in R version 3.1.1 This is what happens: install.packages("tidyr") Installing package into ‘…

r failed-installation installation-package tidyr
Unnesting a list of lists in a data frame column

To unnest a data frame I can use: df <- data_frame( x = 1, y = list(a = 1, b = 2) ) tidyr::unnest(…

r tidyr
splitting multiple values in one column into multiple rows R

I have a data frame which for the most part is one observation per row. However, some rows have multiple …

r dplyr tidyr
How do I use tidyr to fill in completed rows within each value of a grouping variable?

Say I have data on people who choose between several options. I have one row per person, and I want …

r tidyr
Add NAs to make all list elements equal length

I'm doing a series of things in dplyr, tidyr, so would like to keep with a piped solution if possible. …

r dplyr tidyr
dplyr cross tab with missing values

I would like to make a cross tab in R using dplyr. I have good reasons for not just using …

r dplyr tidyr
Unnest a list column directly into several columns

Can I unnest a list column directly into n columns? The list can be assumed to regular, with all elements …

r tidyr tibble