Skip to content

bind_rows: Expecting a string vector: [type=NULL; required=STRSXP]. #3349

@MatthieuStigler

Description

@MatthieuStigler

I am being stuck with dplyr 0.7.4 trying to use bind_rows() (initially: unnest()) on a list of data-frames obtained with broom::augment(), I get error message:
Error in bind_rows_(x, .id) :
Expecting a string vector: [type=NULL; required=STRSXP].

I don't see what is not working, it seems that this is due to a few offending columns... Am I doing something wrong or is there an issue down there?

library(tidyverse)
library(broom)

reg1 <- lm(y~ ., data=freeny)
reg2 <- lm(y~ . -price.index, data=freeny)
regs_df <- data_frame(name=c("reg1", "reg2"),
                      data=list(reg1, reg2)) %>%
  mutate(aug=map(data, augment))

## doesn't work?
regs_df$aug %>%
  bind_rows()

# seem to be linked to specific variables?
vars_issue <- c(2, 9, 12, 13)

regs_df$aug %>%
  map(~select(., -vars_issue)) %>%
  bind_rows()

## what is specific about these variables?
regs_df[1,]$aug[[1]] %>%
  select(vars_issue)

Thanks!!

Metadata

Metadata

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions