Comments (4)
This one has a couple issues:
- The nested column contains tibbles, not data.tables.
unnest.()
currently works by saying "if not a nested data.table, treat the value as a nested vector."
That issue is pretty easily solvable.
- Solving that issue then runs into an issue where the columns are not the same order between the two tibbles.
I'm not sure how to solve that one yet! But I'll work on it. Hopefully I'll have a solution by tomorrow
from tidytable.
Yep that's a good callout. I didn't specify that in the new issue. I'll open another one
from tidytable.
I'm going to close this issue as I solved what this issue was originally about, but I'll open a new one regarding the second issue I mentioned above
from tidytable.
Thanks for quick fix 👍
Where can we put in a fill
, similar to data.table::rbindlist(..., fill)
to allow for extra columns (casted as NA
by fill
)?
library(tidytable)
library(dplyr)
dat <- structure(
list(
id = c("11", "22"),
phase = c("a", "b"),
values = list(
structure(
list(
a = 1.54,
b = 192,
c = "50%"
),
row.names = c(NA, -1L),
class = c("tbl_df",
"tbl", "data.frame")
),
structure(
list(
a = 0.5,
b = 44,
c = "100%",
d = TRUE
),
row.names = c(NA,
-1L),
class = c("tbl_df", "tbl", "data.frame")
)
)
),
row.names = c(NA,
-2L),
class = c("tbl_df", "tbl", "data.frame")
)
dat %>%
unnest.(values)
#> Error in `[.data.table`(.data, , unlist(values, recursive = FALSE), by = keep_cols) :
#> j doesn't evaluate to the same number of columns for each group
# Expected
dat %>% tidyr::unnest(values)
# A tibble: 2 x 6
id phase a b c d
<chr> <chr> <dbl> <dbl> <chr> <lgl>
1 11 a 1.54 192 50% NA
2 22 b 0.5 44 100% TRUE
from tidytable.
Related Issues (20)
- Tidyverse 2 update HOT 1
- Patch release v0.10.2
- `tidytable` fails with `ceiling_date()` function HOT 2
- `distinct` not working with lists HOT 2
- using `pick()` inside `count()` leads to an unhelpful error HOT 5
- deprecated notation HOT 1
- Bug: unnest() HOT 2
- Failure with dev glue HOT 3
- Release v0.11.0 HOT 1
- When two tidytables are subtracted, the class `tidytable` gets lost on the way. HOT 2
- weird error using testthat HOT 2
- exposing list_flatten HOT 1
- summarize with across behaves in a strange way and gives an error when I use lapply inside
- Renaming in `group_by()` can lead to grouping by nonexistent columns
- ifelse and if_else HOT 1
- pmap is not working for data frames HOT 1
- Error "mutate_rowwise()" several columns. HOT 2
- Group_by bug with purrr::reduce HOT 4
- pmap() doesn't name list elements using existing names HOT 2
- `tidytable` objects are not printed after loading `quarto` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tidytable.