Skip to content

Latest commit

 

History

History
70 lines (59 loc) · 2.77 KB

packages.md

File metadata and controls

70 lines (59 loc) · 2.77 KB

Writing R packages

Introduction

Notes from the R Packages book.

The Big Picture

From The Whole Game chapter.

  • Use the devtools package, which contains a set of packages that support package development.
  • Use create_package() to initialise a new package.
  • Use use_r(function_name) to create and/or open a script in R/.
  • Use document() to build the documentation.
  • Use load_all() to load all functions in R/; load_all() simulates the process of building, installing, and attaching.
  • Use check() to check that everything is working.
  • Use install() to install your package.
  • Use use_git() to make a Git repository.
  • Use use_github() to connect to GitHub.
  • Use use_readme_rmd() to create a template README.Rmd file then use build_readme() to render README.md.

Session info

This document was generated by rendering packages.Rmd in RStudio Server.

## [1] "2023-02-09 06:35:22 UTC"

Session info.

## R version 4.2.0 (2022-04-22)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.4 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] ggplot2_3.4.0
## 
## loaded via a namespace (and not attached):
##  [1] rstudioapi_0.14  knitr_1.40       magrittr_2.0.3   tidyselect_1.2.0
##  [5] munsell_0.5.0    colorspace_2.0-3 R6_2.5.1         rlang_1.0.6     
##  [9] fastmap_1.1.0    fansi_1.0.4      dplyr_1.1.0      stringr_1.5.0   
## [13] tools_4.2.0      grid_4.2.0       gtable_0.3.1     xfun_0.34       
## [17] utf8_1.2.3       cli_3.6.0        withr_2.5.0      htmltools_0.5.3 
## [21] yaml_2.3.6       digest_0.6.30    tibble_3.1.8     lifecycle_1.0.3 
## [25] vctrs_0.5.2      glue_1.6.2       evaluate_0.17    rmarkdown_2.17  
## [29] stringi_1.7.12   compiler_4.2.0   pillar_1.8.1     generics_0.1.3  
## [33] scales_1.2.1     pkgconfig_2.0.3