Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in vec_rbind(): #1947

Open
lauraDRH opened this issue Aug 6, 2024 · 0 comments
Open

Error in vec_rbind(): #1947

lauraDRH opened this issue Aug 6, 2024 · 0 comments

Comments

@lauraDRH
Copy link

lauraDRH commented Aug 6, 2024

Hi! I just wanted to report this error

Error in `vec_rbind()`:
! Negative `n` in `compact_rep()`.
ℹ In file utils.c at line 897.
ℹ Install the winch package to get additional debugging info the next time you get this error.
ℹ This is an internal error that was detected in the vctrs package.
  Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex and the full backtrace.
Backtrace:
    ▆
 1. ├─purrr::map_dfr(1:10, ~collect(ss_data), .id = "iteration")
 2. │ └─dplyr::bind_rows(res, .id = .id)
 3. │   └─vctrs::vec_rbind(!!!dots, .names_to = .id, .error_call = current_env())
 4. └─rlang:::stop_internal_c_lib(...)
 5.   └─rlang::abort(message, call = call, .internal = TRUE, .frame = frame)

My code was:

collect <- function(data){
       data %>%  
        uncount(reads) %>% 
        sample_n(n()) %>%  
        mutate(observation=row_number()) %>%  
        arrange(otu, observation) %>% 
        group_by(otu) %>% 
        mutate(distinct= row_number()==1) %>%  
        ungroup %>% 
        arrange(observation)  %>% 
        mutate(s = cumsum(distinct)) %>%    
        select(observation,s) 
    }
  
collect_curves <- map_dfr(1:10, ~ collect(ss_data), .id="iteration") 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant