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

Duplicate names error with example in vignette #28

Closed
zuhadhai opened this issue May 4, 2024 · 2 comments
Closed

Duplicate names error with example in vignette #28

zuhadhai opened this issue May 4, 2024 · 2 comments

Comments

@zuhadhai
Copy link

zuhadhai commented May 4, 2024

Hi, I'm having a bit of trouble getting the first example in the vignette to work for me. Specifically, I get a "Duplicate names not allowed in 'data'." error. I'm using cmdstan-2.31.0, if that helps. I also get
I've attached the code and error output below.

library(idealstan) 
ord_ideal_sim <- id_sim_gen(model='ordinal_grm', inflate = T) 

 
true_legis <- ord_ideal_sim@simul_data$true_person 
high_leg <- sort(true_legis,decreasing = TRUE,index.return=TRUE) 
low_leg <- sort(true_legis,index.return=TRUE) 
 
ord_ideal_est <- id_estimate(idealdata=ord_ideal_sim, 
                             model_type=6, 
                             fixtype='prefix', 
                             restrict_ind_high = as.character(high_leg$ix[1]), 
                             restrict_ind_low=as.character(low_leg$ix[1]), 
                             id_refresh=500, 
                             ncores=1, 
                             nchains=2)                                                                          
[1] "Compiling model. Will take some time as this is the first time package is used."
[1] "Have you thought about donating to relief for victims for Yemen's famine?"
[1] "Check out https://www.unicef.org/emergencies/yemen-crisis for more info."
Model executable is up to date!
[1] "Estimating model with full Stan MCMC sampler."
Error: Duplicate names not allowed in 'data'.
In addition: Warning messages:
1: In max(Y_cont) : no non-missing arguments to max; returning -Inf
2: In max(Y_cont) : no non-missing arguments to max; returning -Inf
@saudiwin
Copy link
Owner

saudiwin commented May 6, 2024

Hi Zuhad -

I am releasing a big update of the package in a bit so the current version is a bit out of sync. You can install the development version with the following command:

remotes::install_github("saudiwin/idealstan", ref="develop")

I just tested the above vignette code and it works fine. If you find any other bugs though please do let me know, thanks.

@zuhadhai
Copy link
Author

zuhadhai commented May 6, 2024

Hi Robert, thanks for the quick response! I installed the development version and now it works like a charm, thanks!

@zuhadhai zuhadhai closed this as completed May 6, 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