inbo / checklist

An R package for checking R packages and R code
https://inbo.github.io/checklist
GNU General Public License v3.0
16 stars 2 forks source link

README getting started instructions are unclear to me #138

Closed adamhsparks closed 1 month ago

adamhsparks commented 1 month ago

Glancing over the README I tried to follow the instructions given but it ends with errors, so I had to dig further into the vignettes to find the proper steps, which also resulted in an error for the other issue I've opened.

After following the install instructions, I followed the next steps but get an error.

library(checklist)
check_package()

Checking spelling
Error:
! no checklist.yml found `.` or its parents
Show Traceback
ThierryO commented 1 month ago

Good catch. In the past you could run the checks without setting checklist up. I need to update the README and make the error message more clear.

ThierryO commented 1 month ago

I've updates the README. Could you please give me feedback on this version?

adamhsparks commented 1 month ago

Thanks for the updates. This really does seem useful, even outside INBO.

However, I'm still running into errors when I follow the README.

After installing, I load the library and create my own org like so.

> library(checklist)
> org <- organisation$new(
+   github = "AAGI-Org-AU-Public",
+   community = NA_character_,
+   email = "adam.sparks@curtin.edu.au",
+   rightsholder = "Grains Research and Development Corporation (GRDC), Curtin University, The University of Queensland, University of Adelaide",
+   funder = "Grains Research and Development Corporation (GRDC), Curtin University of Technology, The University of Queensland, University of Adelaide",
+   organisation = list(
+     "Curtin University" = list(affiliation = "Curtin University", orcid = TRUE)
+   )
+ )

When I then try to set the default org, I get an error.

> default_organisation(org = org)
Error in file(file, "w", encoding = fileEncoding) : 
  cannot open the connection
In addition: Warning message:
In file(file, "w", encoding = fileEncoding) :
  cannot open file '/Users/283204f/Library/Preferences/org.R-project.R/R/checklist/organisation.yml': No such file or directory
ThierryO commented 1 month ago

That might be a bug in default_organisation(). I presume it is because the folder /Users/283204f/Library/Preferences/org.R-project.R/R/checklist doesn't exist on your machine. Could you try the code below. If that works, then I know to fix the issue.

dir.create(R_user_dir("checklist", which = "config"))
default_organisation(org = org)
adamhsparks commented 1 month ago

Prefixing tools:: works locally.

Then the default_organisation(org = org) is able to be set.

dir.create(tools::R_user_dir("checklist", which = "config"))
default_organisation(org = org)