Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
R in Action, Second Edition.pdf
Скачиваний:
540
Добавлен:
26.03.2016
Размер:
20.33 Mб
Скачать

Creating a package

This chapter covers

Creating the functions for a package

Adding package documentation

Building the package and sharing it with others

In previous chapters, you completed most tasks by using functions that were provided by others. The functions came from packages in the base R installation or from contributed packages downloaded from CRAN.

Installing a new package extends R’s functionality. For example, installing the mice package provides you with new ways of dealing with missing data. Installing the ggplot2 packages provides you with new ways of visualizing data. Many of R’s most powerful capabilities come from contributed packages.

Technically, a package is simply a set of functions, documentation, and data, saved in a standardized format. A package allows you to organize your functions in a well-defined and fully documented manner and facilitates sharing your programs with others.

There are several reasons why you might want to create a package:

To make a set of frequently used functions easily accessible, along with the documentation on how to use them

491

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]