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

ic_np does not like raw matrices of data #11

Open
hhau opened this issue Sep 23, 2021 · 0 comments
Open

ic_np does not like raw matrices of data #11

hhau opened this issue Sep 23, 2021 · 0 comments

Comments

@hhau
Copy link

hhau commented Sep 23, 2021

Hi! Thanks for the package!

I am a bit confused about how to use ic_np. I only have one group, so https://github.com/pistacliffcho/icenReg_devel/blob/master/Code/icenReg/R/ic_np.R#L8-L9 makes it seem like I do not need the formula argument:

library(icenReg)
#> Loading required package: survival
#> Loading required package: Rcpp
#> Loading required package: coda

l <- rbinom(n = 250, size = 1, prob = 0.5)
u <- rpois(n = 250, lambda = 10) + 1

# error
icenReg::ic_np(data = cbind(l, u))
#> Error in rep(1, nrow(data)): invalid 'times' argument

# get next error by manually specifying weights:
icenReg::ic_np(data = cbind(l, u), weights = rep(1, times = length(l)))
#> Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), : 'data' must be of a vector type, was 'NULL'

but it looks like you intend for the function to be called as icenReg::ic_np(cbind(l, r)), i.e. excluding the data argument when there are no groups. It might be possible to throw a more informative error if ic_np is called without a formula argument yet with a data argument? Or at least tweak the docs / include the fixed version of the above as an example.

Thanks again!

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