![]() ![]() Some maintainers forget to list this URL, even though the package is developed in a public repository, but you still might be able to discover it via search.Įven if a package is not developed on a public platform, you can visit its source in the unofficial, read-only mirror maintained by R-hub. The best case scenario is that you visit the package’s CRAN landing page, e.g.:Īnd one of its URLs links to a repository on a public hosting service, e.g.: Many R packages are developed in the open on GitHub (or GitLab or similar). The easiest way to see a package in source form right away is to browse around its code on the web. If you are new to package development, you may have never seen a package in source form! You might not even have any source packages on your computer. ![]() Most of the remaining chapters in this book are dedicated to detailing these components. It includes particular components, such as a DESCRIPTION file, an R/ directory containing. 4.2 Source packageĪ source package is just a directory of files with a specific structure. The library() function loads an installed package into memory, making it available for immediate and direct use. devtools::install_github() takes a source package on GitHub and moves it into the installed state. For example, install.packages() can move a package from the source, bundled, or binary states into the installed state. You already know some of the functions that put packages into these states. ![]() ![]() Package development workflows make much more sense if you understand the five states an R package can be in: This is NOT the package form you are most familiar with from day-to-day usage. You interact with the in-development package in its source form. When you create or modify a package, you work on its “source code” or “source files”. You’ll learn about the various states a package can be in and the difference between a package and library (and why you should care). This chapter will start you on the road to package development by converting the implicit knowledge you’ve gained from using R packages into the explicit knowledge needed to create and modify them. ![]()
0 Comments
Leave a Reply. |