Comments (3)
test <- rowwise(test)
and rbind(test, test)
seem to me like create a sort of recursive data. oO ?!
dput(test)
structure(list(col1 = c(1, 2, 3, 4, 5, 85, 74, 5, 32, 6, 8, 1,
2, 3, 4, 5, 85, 74, 5, 32, 6, 8), col = c("A", "B", "B", "B",
"A", "C", "A", "C", "B", "A", "A", "A", "B", "B", "B", "A", "C",
"A", "C", "B", "A", "A")), row.names = c(NA, -22L), groups = structure(list(
.rows = structure(list(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L,
10L, 11L), ptype = integer(0), class = c("vctrs_list_of",
"vctrs_vctr", "list"))), row.names = c(NA, -11L), class = c("tbl_df",
"tbl", "data.frame")), class = c("rowwise_df", "tbl_df", "tbl",
"data.frame"))
Try that:
test1 <- data.frame("col1" = c(1,2,3,4,5,85,74,5,32,6,8), "col" = c("A","B","B","B","A","C","A","C","B","A","A"))
test2 <- rowwise(test1)
test0 <- rbind(test1, test2)
test0 has a normal structure:
dput(test0)
structure(list(col1 = c(1, 2, 3, 4, 5, 85, 74, 5, 32, 6, 8, 1,
2, 3, 4, 5, 85, 74, 5, 32, 6, 8), col = c("A", "B", "B", "B",
"A", "C", "A", "C", "B", "A", "A", "A", "B", "B", "B", "A", "C",
"A", "C", "B", "A", "A")), row.names = c(NA, -22L), class = "data.frame")
And filter works:
dplyr::filter(test0, col == "A")
col1 col
1 1 A
2 5 A
3 74 A
4 6 A
5 8 A
6 1 A
7 5 A
8 74 A
9 6 A
10 8 A
PS: I'm a simple user (ie not from the tidyverse team).
from dplyr.
My issue is that sometimes I use rbind on objects that both are grouped row-wise. This seems to create a recursive thing that make RStudio crash
This structure seems to be normal for dataframes grouped row-wise :
test1 <- data.frame("col1" = c(1,2,3,4,5,85,74,5,32,6,8), "col" = c("A","B","B","B","A","C","A","C","B","A","A"))
test01 <- rowwise(test1)
dput(test01)
structure(list(col1 = c(1, 2, 3, 4, 5, 85, 74, 5, 32, 6, 8),
col = c("A", "B", "B", "B", "A", "C", "A", "C", "B", "A",
"A")), class = c("rowwise_df", "tbl_df", "tbl", "data.frame"
), row.names = c(NA, -11L), groups = structure(list(.rows = structure(list(
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L), ptype = integer(0), class = c("vctrs_list_of",
"vctrs_vctr", "list"))), row.names = c(NA, -11L), class = c("tbl_df",
"tbl", "data.frame")))
But without rbind it does not crash :
dplyr::filter(test01, col == "A")
# A tibble: 5 × 2
# Rowwise:
col1 col
<dbl> <chr>
1 1 A
2 5 A
3 74 A
4 6 A
5 8 A
from dplyr.
This might be a duplicate of #7024, the issue was transferred to r-lib/vctrs#1935
from dplyr.
Related Issues (20)
- group_split(): add a '.groups_to_names=T' type argument HOT 2
- `group_split()` not shown on the reference page
- Modify how arrange sorts strings HOT 3
- Should `desc()` use `vec_rank()` internally on character vectors?
- Problem Group_by
- `dplyr_reconstruct` can create data.table with corrupted secondary index HOT 1
- Split `join_cols()`
- Error in the function 'across()' HOT 3
- Documentation error for count HOT 4
- `if_else` `missing` argument does not work when using `%in%` to evaluate. HOT 3
- Add a Ranking Function to Compute Tail Means HOT 1
- across(), but over two sets of vector
- Look at dplyrover HOT 1
- `if_any` on zero-column selection yields `TRUE` HOT 2
- Typo in cumulative function docs
- `bind_rows` does not capture `tapply` output names with `.id` parameter HOT 1
- A subtle scoping flaw in pull()
- Feature Request: add `.groups = "drop"` option to `mutate` HOT 3
- Feature request: global option for summarise .groups setting HOT 1
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 dplyr.