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

as.json no longer functioning on Cohort object in version 2.0.8 #97

Open
guuswilmink opened this issue Jun 26, 2024 · 5 comments
Open

Comments

@guuswilmink
Copy link

guuswilmink commented Jun 26, 2024

Whilst following the user guide, I came across the following error:

giBleedCohortJson <- as.json(giBleedCohort)
Error: unable to find an inherited method for function ‘as.json’ for signature ‘x = "Cohort"’.

Downgrading to version 2.0.7 shows the problem only arises in version 2.0.8, as version 2.0.7 runs as.json as intended.

EDIT:
version 2.0.7 actually seems to present a similar issue. The problem seems to start from version 2.0.6 onward.

@guuswilmink
Copy link
Author

This error occurred due to using a named vector as an input rather than an unnamed vector of concept IDs. Closing issue.

@mdlavallee92
Copy link
Collaborator

glad you sorted it out, thanks for posting an issue

@guuswilmink
Copy link
Author

Apologies for the confusion. The as.json function does appear broken after all, producing the same error provided previously (regardless of using a named or unnamed vector). Downgrading to 2.0.5 alleviates the problem for both named and unnamed vectors (though named vectors produce a faulty json down the line).

If necessary, I can provide the exact code I'm using, though I am able to reproduce the error by following the user guide to the letter.

@guuswilmink guuswilmink reopened this Jun 27, 2024
@JetKinTanAccelteam
Copy link

may I ask what is name vector of concept IDs in this case?

@guuswilmink
Copy link
Author

Hi @JetKinTanAccelteam,
I originally thought the issue was caused by using a vector with named values and mistakenly thought it was resolved by using a vector with unnamed values. The same issue unfortunately persisted.
The error should be reproduced when following these steps:
https://ohdsi.github.io/Capr/articles/Using-Capr.html

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

3 participants