Читать книгу The Big R-Book - Philippe J. S. De Brouwer - Страница 170

Note – Cold code in this section

Оглавление

While in the rest of the book, most code is “active” in this sense that the output that appears under a line or the plot that appears close to it are generated while the book was compiled, the code in this book is “cold”: the code is not executed. The reason is that the commands fromthis sectionwould produce long and irrelevant output. The listswould be long, because the author's computer has many packages installed, but also little relevant to you, because you have certainly a different configuration. Other commandswould even change packages as a side effect of compiling this book.

A first step in managing packages is knowing which packages can be updated.

# List all out-dated packages: old.packages()

Once we know which packages can be updated, we can execute this update:

# Update all available packages: update.packages()

If you are very certain that you want to update all packages at once, use the ask argument:

# Update all packages in batch mode: update.packages(ask = FALSE)

During an important project, you will want to update just one package to solve a bug and keep the rest what as they are in order to reduce the risk that code needs to rewritten and debugged while you are struggling to keep your deadline. Updating a package is done by the same function that is used to install packages.

# Update one package (example with the TTR package): install.packages(“TTR”)

The Big R-Book

Подняться наверх