Skip to content
This repository has been archived by the owner. It is now read-only.
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

erum2018

"Building a package that lasts" — eRum 2018 workshop

Program

Coffee Break: 15h - 15h30

Functions for the workshop

(if you're not planning on using your own)

init_data_raw <- function(name = "devstuffs"){
  stop_if_not(name, is.character, "Please use a character vector")
  use_data_raw()
  
  new_file_path <- glue({here()}, "/data-raw/{name}.R")
  file.create(new_file_path)
  file.edit(new_file_path)
}

init_docs <- function(name = "Colin FAY"){
  stop_if_not(name, is.character, "Please use a character vector")
  use_mit_license(name)
  use_readme_rmd()
  use_news_md()
  use_testthat()
}

fill_desc <- function(name, Title, Description, repo){
  unlink("DESCRIPTION")
  my_desc <- desc::description$new("!new")
  my_desc$set("Package", name)
  my_desc$set("Authors@R", "person('Colin', 'Fay', email = 'contact@colinfay.me', role = c('cre', 'aut'))")
  my_desc$del("Maintainer")
  my_desc$set_version("0.0.0.9000")
  my_desc$set(Title = Title)
  my_desc$set(Description = Description)
  my_desc$set("URL", glue("https://github.com/ColinFay/{repo}"))
  my_desc$set("BugReports", glue("https://github.com/ColinFay/{repo}/issues"))
  my_desc$write(file = "DESCRIPTION")
}


fill_desc_generic <- function(name, Title, Description = "Here", repo,
                              first_name = "Colin",
                              last_name = "Fay",
                              github_user = "ColinFay",
                              email = "contact@colinfay.me",
                              role = "c('cre', 'aut')",
                              version = "0.0.0.9000"){
  unlink("DESCRIPTION")
  my_desc <- desc::description$new("!new")
  my_desc$set("Package", name)
  my_desc$set("Authors@R",
              glue("person('{first_name}', '{last_name}', email = '{email}', role = {role}"))
  my_desc$del("Maintainer")
  my_desc$set_version(version)
  my_desc$set(Title = Title)
  my_desc$set(Description = Description)
  my_desc$set("URL", glue("https://github.com/{github_user}/{repo}"))
  my_desc$set("BugReports", glue("https://github.com/{github_user}/{repo}/issues"))
  my_desc$write(file = "DESCRIPTION")
}

About

"Building a package that lasts" — eRum 2018 workshop

Resources

Releases

No releases published

Packages

No packages published