Skip to content

quantile() method for dist_quantiles should produce NAs as needed, not error #414

@dajmcdon

Description

@dajmcdon
library(epipredict)
distn <- dist_quantiles(
  list(1:5, 1:5, c(NA, NA), 1:2), 
  list(1:5/6, 1:5/6, 1:2/3, 1:2/3)
)
quantile(distn, p = .5)
#> Error in `quantile_extrapolate()`:
#> ! Quantile extrapolation is not possible with fewer than 2 quantiles.
quantile(distn[-3], p = .5)
#> [1] 3.0 3.0 1.5
quantile(distn, p = .5, na.rm = TRUE)
#> Error in `quantile_extrapolate()`:
#> ! Quantile extrapolation is not possible with fewer than 2 quantiles.

Created on 2024-10-17 with reprex v2.1.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions