#Paquetes necesarios
pacman::p_load(
    #test
    pkgload,testthat,
    #data tools
    tidyverse, janitor, glue, lubridate, scales, Hmisc,lazyeval,
    #Gráficos
    plotly, ggrepel, cowplot, grid, fmsb, 
    #importar / exportar
    haven, rio, officer, officedown,
    #Etiquetas
    sjlabelled,
    #tablas
    flextable, knitr, kableExtra, DT, gtsummary,
    #Temas
    ggpubr,
    #Colores
    paletteer, RColorBrewer
    )

All commands that you use to use when developing packages...

First time just after creating the project

# Describe your package
fusen::fill_description(
  pkg = here::here(),
  fields = list(
    Package = "pulso",
    Title = "Funciones para los informes Pulso PUCP",
    Description = "Conjunto de funciones para los informes de Pulso PUCP.",
    `Authors@R` = c(person(given = "Santiago", 
                           family = "Sotelo", 
                           email = "santiago.sotelo@pucp.edu.pe", 
                           role = c("aut", "cre"), 
                           comment = c(ORCID = "0000-0002-9739-9964"))),
    Language =  "es"
  ), overwrite = TRUE
)

# Define License with use_*_license()
usethis::use_mit_license("Santiago Sotelo")

Start using git

usethis::use_git()
# Deal with classical files to ignore
usethis::git_vaccinate()

Set extra sources of documentation

# README
usethis::use_readme_rmd()
#file.remove(".git/hooks/pre-commit")

# Code of Conduct
usethis::use_code_of_conduct("contact@fake.com")
# NEWS
usethis::use_news_md()

From now, you will need to "inflate" your package at least once to be able to use the following commands. Let's go to your flat template, and come back here later if/when needed.

Package development tools

Use once

# Pipe
usethis::use_pipe()

# package-level documentation
usethis::use_package_doc()

# Set CI
# _GitHub
usethis::use_github_action_check_standard()
usethis::use_github_action("pkgdown")
usethis::use_github_action("test-coverage")
# _GitLab
gitlabr::use_gitlab_ci(type = "check-coverage-pkgdown")

# Add new flat template
fusen::add_flat_template("add")

Use everytime needed

# Simulate package installation
pkgload::load_all()

# Generate documentation and deal with dependencies
attachment::att_amend_desc()

# Check the package
devtools::check()

# Make your dataset file available to the current Rmd
pkgload::load_all(path = here::here(), export_all = FALSE)

Share the package

# set and try pkgdown documentation website
usethis::use_pkgdown()
pkgdown::build_site(override=list(lang="es"))#oh, now we are talking
pkgdown::build_site_github_pages(override=list(lang="es"))

# build the tar.gz to share with others
devtools::build()


aito123/pulso documentation built on June 21, 2022, 4:32 p.m.