Closed BatoolMM closed 8 months ago
This is + traceback:
Error in fromJSON(file = json_file) :
either json_str or file must be supplied to fromJSON
3. stop("either json_str or file must be supplied to fromJSON")
2. fromJSON(file = json_file) at domain_mapping.R#38
1. domain_mapping()
@RayStick Very stupid question but am I supposed to provide the json_file inside the function when I run the function.
I think I have been running it without json_file!
Let me check :D
Do you run the steps like this for the demo?
This is what I have been running:
library(devtools)
devtools::load_all()
?domain_mapping
domain_mapping()
but now that I run:
domain_mapping(,, TRUE)
it's working, yah!!!
Another question, is there a reason why the 3rd argument isn't by default TRUE, is this to avoid another issue?
Great =D
What this TRUE means is demo_mode = TRUE
The normal way to run it would be domain_mapping(json_file, domain_file)
with the last argument by default FALSE because it is not in demo mode. For demo mode, it does not need any arguments but you need to tell it to run it as demo mode by changing demo_mode = TRUE
.
Does that make sense? Do you think there is a better way to approach it?
Maybe I can code something that says if no input arguments are given, it triggers demo mode. And remove this argument altogether?
It makes total sense - thank you for the clarification!
I am trying to recall examples where R packages have similar approach, it's usually the 1st argument that is used to trigger example. Let me sleep on this and see what is best practices!
I am very happy that it's working now!
Yes, we can return to this, no rush. Would be good to do what is typical for an R package, so let me know!
I am looking into the 2nd point with CMD check - no need to reply today - I am just adding my points and questions to come back to it.
I don't see that any of the dependencies mentioned in DESCRIPTION file. Also, I would also use ::
always when recall any of the packages inside a new function. I usually don't do that in regular script but inside a new function within a new pkg, it's highly recommended.
To summarize a few points from our call. Before public release we want:
domain_mapping
Perhaps a PR for each?
Thank you, yes, it makes sense to have 2 PRs.
As mentioned in #22, we need to address two issues to make sure all function work before creating any docs:
domain_mapping()
function is working Current error:N checking R code for possible problems (4.7s) domain_mapping: no visible global function definition for ‘data’ domain_mapping: no visible binding for global variable ‘json_metdata’ domain_mapping: no visible binding for global variable ‘domains_list’ domain_mapping: no visible global function definition for ‘fromJSON’ domain_mapping: no visible global function definition for ‘read.csv’ domain_mapping: no visible global function definition for ‘plot.new’ domain_mapping: no visible global function definition for ‘grid.table’ domain_mapping: no visible global function definition for ‘print_colour’ domain_mapping: no visible global function definition for ‘write.csv’ Undefined global functions or variables: data domains_list fromJSON grid.table json_metdata plot.new print_colour read.csv write.csv Consider adding importFrom("graphics", "plot.new") importFrom("utils", "data", "read.csv", "write.csv") to your NAMESPACE file.
W checking for missing documentation entries ... Undocumented code objects: ‘domains_list’ ‘json_metdata’ Undocumented data sets: ‘domains_list’ ‘json_metdata’ All user-level objects in a package should have documentation entries. See chapter ‘Writing R documentation files’ in the ‘Writing R Extensions’ manual.