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 loading a data frame as input data in hBayesDM R version #112

Closed
youngahn opened this issue Sep 15, 2019 · 7 comments
Closed

Error loading a data frame as input data in hBayesDM R version #112

youngahn opened this issue Sep 15, 2019 · 7 comments
Labels

Comments

@youngahn
Copy link
Member

Here is a code that will reproduce the error displayed below

dd_path = system.file('extData/dd_exampleData.txt', package = 'hBayesDM')  # path to a data file
dd_tmp = read.table(dd_path, header=T, sep="\t")  # load the file into a data.frame
output = dd_hyperbolic(dd_tmp, 1000, 500, 1, 1)   # run the dd_hyperbolic model

Output
Model name = dd_hyperbolic
Data file = Error in cat("Data file =", data, "\n") :
argument 2 (type 'list') cannot be handled by 'cat'

@youngahn youngahn added the bug label Sep 15, 2019
@youngahn
Copy link
Member Author

This bug is fixed in v1.0.2 (https://github.com/CCS-Lab/hBayesDM/tree/hotfix/v1.0.2), which isn't available in CRAN yet. You can install the fixed version with the following R line:

devtools::install_github("CCS-Lab/hBayesDM", ref = "hotfix/v1.0.2", subdir = "R")

@fusaroli
Copy link

I ran into this issue with a couple of different datasets and I can confirm it's now fixed

@fusaroli
Copy link

Any news as to when this is going to go to CRAN? I have a student experiencing issues when trying to compile the patch.

@youngahn
Copy link
Member Author

Thanks for asking! We will submit the latest (fixed) version sometime this week.

Best,
Young

@JacobElder
Copy link

I had the same error as the poster but installing the patch listed above did not resolve it. Quick comment-- While the hBayesDM documentation, example data, and instructions say that you should label IDs as "subjID", after looking at the source code, it turns out it should be "subjid" which led to my errors it seems. After changing it works.

The help documentation for 2 armed bandit says:
For the 2-Armed Bandit Task, there should be 3 columns of data with the labels "subjID", "choice", outcome". It is not necessary for the columns to be in this particular order, however it is necessary that they be labeled correctly and contain the information below:

@youngahn
Copy link
Member Author

@JacobElder Thanks for reporting the potential bug. Would you be able to share your sample code regarding 'subjID'?

Yes that's correct that the order of columns does not matter.

@youngahn
Copy link
Member Author

v1.0.2 is now available in CRAN and the bug is fixed in the latest 1.0.2 version.

https://cran.r-project.org/web/packages/hBayesDM/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants