Achilles
Achilles copied to clipboard
Fix fromJSON correct method usage
This is a possible fix for #726
I do not believe this is correct, from the usage documentation:
fromJSON( json_str, file, method = "C", unexpected.escape = "error", simplify = TRUE )
The change made from fromJSON(file = xxx}
is not the same as fromJSON(xxx)
.
You are looking at the wrong documentation @chrisknoll. What you quoted is the fromJSON function from the rjson package. Achillles however switched to the jsonlite package a year ago. The documentation of the fromJSON function that Achilles actually has within its namespace is thus:
fromJSON(
txt,
simplifyVector = TRUE,
simplifyDataFrame = simplifyVector,
simplifyMatrix = simplifyVector,
flatten = FALSE,
...
)
Specifying file = xxx
thus ensures that the path argument just gets passed into the ...
, thus the errors about fromJSON missing its txt
argument anyone trying to use the current production version of your package encounters.
Thanks for the clarification. Wasn't aware about the change in the JSON library.
Hi @chrisknoll, @fdefalco
+1 for the patch! 👍
I know that I’m not supposed to do it, but… I’m still using AchillesExport for it’s really convenient and not being able to export is a real blocker.
@fdefalco +1 for this PR I reviewed it and it makes sense to me.
Another request for this PR to be reviewed and merged: https://forums.ohdsi.org/t/error-in-jsonlite-fromjson-file-treemapfile-argument-txt-is-missing-with-no-default/19069/9?u=chris_knoll
We are getting the same error :( I am unable to find the function exportToJson.R inside Achilles package directory to make the edits per PR. Any thoughts on this?