Skip to content

dust() does not allow 1 column tables #123

@charlieflipside

Description

@charlieflipside
# works
dust(mtcars) %>% sprinkle_print_method("console")

mpg cyl disp hp drat wt qsec vs am gear carb
1 21 6 160 110 3.9 2.62 16.46 0 1 4 4
2 21 6 160 110 3.9 2.875 17.02 0 1 4 4

# error
dust(mtcars[, "mpg"]) %>% sprinkle_print_method("console")

Error in .rbind_internal(if (nrow(head) > 1) subhead else NULL, body[Divisions$row_num[Divisions$div_num == : All objects in ... must be data frames

Similarly:

# error
dust(
  data.frame(
      col1 = "hi"
  )
) %>% sprinkle_print_method("console")

Error in .rbind_internal(if (nrow(head) > 1) head[-1, ] else NULL, body[Divisions$row_num[Divisions$div_num == : All objects in ... must be data frames

# works
dust(
  data.frame(
      col1 = "hi",
      col2 = "hello"
  )
) %>% sprinkle_print_method("console")

col1 col2
1 hi hello

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions