Skip to contents

create a codemeta list object in R for further manipulation. Similar to write_codemeta(), but returns an R list object rather than writing directly to a file. See examples.

Usage

create_codemeta(
  pkg = ".",
  root = ".",
  id = NULL,
  use_filesize = FALSE,
  force_update = getOption("codemeta_force_update", TRUE),
  verbose = TRUE,
  ...
)

Arguments

pkg

package path to package root, or description file (character), or a codemeta object (list)

root

if pkg is a codemeta object, optionally give the path to package root. Default guess is current dir.

id

identifier for the package, e.g. a DOI (or other resolvable URL)

use_filesize

whether to try to estimating and adding a filesize by using base::file.size(). Files in .Rbuildignore are ignored.

force_update

Update guessed fields even if they are defined in an existing codemeta.json file

verbose

Whether to print messages indicating opinions e.g. when DESCRIPTION has no URL. – See give_opinions; and indicating the progress of internet downloads.

...

additional arguments to write_json

Value

a codemeta list object

Examples

# \donttest{
path <- system.file("", package="codemeta")
cm <- create_codemeta(path)
#> … Asking README URL from GitHub API
#> ✔ Got README URL!
#> … Asking README URL from GitHub API
#> ✔ Got README URL!
#> … Getting repo topics from GitHub API
#> ✔ Got repo topics!
#> … Getting CRAN metadata from RStudio CRAN mirror
#> ✔ Got CRAN metadata!
cm$keywords <- list("metadata", "ropensci")
# }