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 purrr::map_dbl() caused by error in quantile.default(): ! missing values and NaN's not allowed if 'na.rm' is FALSE #21

Closed
r-ola opened this issue Jan 23, 2024 · 2 comments

Comments

@r-ola
Copy link

r-ola commented Jan 23, 2024

While I was using circumplex package I got the following error message:

Error in **purrr::map_dbl()**:
ℹ In index: 1.
ℹ With name: t1.
Caused by error in **quantile.default()**:
! missing values and NaN's not allowed if 'na.rm' is FALSE

I tried to analyse circumplex data using this code:

res.a1 <- ssm_analyze(.data = df.area1, 
    scales = c(a.pos1, v.neg1, a.neg1, v.pos1),                          
    angles = c(90, 180, 270, 360),
    measures = c(safe1, inter1), 
    measures_labels = c('Safety', 'Interaction')) 
summary(res.a1)

This is the backtrace:

Backtrace:
 1. ├─circumplex::ssm_analyze(...)
 2. │ └─circumplex:::ssm_analyze_corrs(...)
 3. │   └─circumplex:::ssm_bootstrap(...)
 4. │     └─... %\>% dplyr::select(-fit_lci)
 5. ├─dplyr::select(., -fit_lci)
 6. ├─circumplex (local) reshape_params(., suffix = "lci")
 7. │ └─... %\>% tibble::as_tibble(nrow = nrow(.))
 8. ├─tibble::as_tibble(., nrow = nrow(.))
 9. ├─base::`colnames<-`(...)
10. │ └─base::is.data.frame(x)
11. ├─base::matrix(., ncol = 6, byrow = TRUE)
12. └─purrr::map_dbl(., .f = quantile, probs = ((1 - interval)/2))
13. └─purrr:::map\_("double", .x, .f, ..., .progress = .progress)
14.     ├─purrr:::with_indexed_errors(...)
15.     │ └─base::withCallingHandlers(...)
16.     ├─purrr:::call_with_cleanup(...)
17.     ├─stats (local) .f(.x[[i]], ...)
18.     └─stats:::quantile.default(.x[[i]], ...)
19.       └─base::stop("missing values and NaN's not allowed if 'na.rm' is FALSE")
Run rlang::last_trace(drop = FALSE) to see 4 hidden frames.

There are no missing values nor NaNs in my dataframe.

Dataframe sample:

id        v.neg1        v.pos1     a.neg1       a.pos1       inter1   safe1

1   -0.1031421  -1.7056656  -1.6342515  -0.2935107  6   5

2   -0.1031421  -0.7625329  0.9694712   -0.2935107  5   7

3   -0.1031421  0.1805999   0.3185405   -0.2935107  7   8

4   9.5922176   1.1237326   0.3185405   -0.2935107  3   8

5   -0.1031421  0.1805999   0.3185405   -0.2935107  5   8

6   -0.1031421  1.1237326   0.9694712   -0.2935107  8   8

7   -0.1031421  -0.7625329  -1.6342515  -0.2935107  5   5

8   -0.1031421  -1.7056656  -1.6342515  -0.2935107  4   5

9   -0.1031421  0.1805999   -1.6342515  -0.2935107  6   7

10  -0.1031421  2.0668654   0.9694712   -0.2935107  9   9

How can I resolve this error? Thank you in advance!

@jmgirard
Copy link
Owner

Can you confirm you have the newest version of circumplex installed?

@r-ola r-ola closed this as completed Jan 30, 2024
@r-ola r-ola reopened this Jan 30, 2024
@jmgirard
Copy link
Owner

jmgirard commented Jan 30, 2024

Can you please email me ([email protected]) either your exact dataframe or a subset or an MRE that produces the problem (ideally as an RDS file via writeRDS())? I can then track down the problem and report back.

@r-ola r-ola closed this as completed Jan 31, 2024
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

2 participants