CrumpLab / vertical

R workflow for sharing psychological research
https://crumplab.github.io/vertical/
Other
35 stars 2 forks source link

Limit dependencies #48

Closed mvuorre closed 4 years ago

mvuorre commented 4 years ago

Currently, we have

Imports:
    devtools,
    usethis,
    pkgdown,
    httr,
    papaja,
    yaml,
    posterdown,
    rmarkdown,
    sinew,
    git2r,
    rstudioapi

And if you run CHECK, there's more:

> checking dependencies in R code ... WARNING
  '::' or ':::' imports not declared from:
    ‘gtools’ ‘rlist’ ‘ymlthis’

How many of these are actually required? When functions used from those packages change, vertical has to change correspondingly. Just trying to make the package as lightweight and easy to maintain as possible.

It seems that it should be possible to do just with usethis, devtools, pkgdown, and then the packages that are used in the modules (e.g. papaja).

CrumpLab commented 4 years ago

I'll try to make progress on this today. I've deleted sinew which is no longer used. We need httr to grab jspsych. I've added gtools, rlist, and ymlthis to the imports. The last three are all used in vertical::suggest_yml() for minor tasks that I might be able to rewrite (gtools::split_path() is also used in build_vertical()). Currently the dev branch passes a check with no errors on my end.

CrumpLab commented 4 years ago

Just making some notes here about what is currently being used that might be trimmed:

  1. gtools::split_path() This function splits a path by the path separator, used in suggest_yml(), and build_vertical.

    • could replace with unlist(strsplit(x, split = .Platform$file.sep))
  2. rlist::list.append() a helper function for appending to a list, used in suggest_yml()

    • looks like I can remove this and use a simple c() statement.
  3. ymlthis::as_yml()prints a yml object to the console. used insuggest_yml()

CrumpLab commented 4 years ago

I've made a few changes todev addressing these issues.

  1. suggest_yml and build_vertical no longer depend on gtools, rlist, or ymlthis

  2. The current list of imports is:

Imports:
    devtools,
    usethis,
    pkgdown,
    httr,
    papaja,
    yaml,
    posterdown,
    rmarkdown,
    git2r,
    rstudioapi
Remotes: 
    github::crsh/papaja,
    github::CrumpLab/jspsychr
Suggests:
    knitr
  1. CHECK passes with no errors.
CrumpLab commented 4 years ago

closing this issue