refresh: R packaging tools controlled from within the running R...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/refresh.R

Description

You have changed a tiny detail in a man page of your R package, or rewritten the main function of your R package, then you want to re-build and re-install the package. This function is for lazy people like me who do not each time want to open a terminal, find the syntax "R CMD ...", restart R. Enjoy.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
refresh(
  pkg,
  lib = options()$refreshLibrary,
  Source = options()$refreshSource,
  roxy = FALSE,
  ask = FALSE,
  recursive = FALSE,
  docs = TRUE,
  vignettes = TRUE,
  verbose = 2
)

Arguments

pkg

The quoted or unquoted name of the package

lib

A directory in which to install the package. Default is options()$refreshLibrary. The directory should be in .libPaths().

Source

A list of directories or a single directory where to find the package source code. Default is options()$refreshSource

roxy

if TRUE call roxygenize before building

ask

If TRUE ask for Archive and Source directories.

recursive

If TRUE search in subdirectories of Archive.

docs

If FALSE add flag " --no-docs" to the R CMD install command.

vignettes

If FALSE add flag " --no-vignettes" to the R CMD build command.

verbose

Decides about the degree of talkitivity.

Value

Nothing

Author(s)

Thomas A. Gerds <tag@biostat.ku.dk>

See Also

build

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## Not run: 
refresh(Refresh)

# Suppose you have an R-package called 'roadrunner'.
# 
# (Recall that an R-package is just a directory in your
# file-system which includes a valid DESCRIPTION file
# and sub-directories called 'R', 'man', 'data', 'example')
#
# Suppose further that the R-package 'roadrunner' is
# a subdirectory of the directory '~/R/iDevel/'
# Then, the following command will try to install the
# package to the subdirectory '~/R/library'  
##

refresh("roadrunner",lib="~/R/library",Source="~/R/iDevel/")

##
# If this works, then you may want to customize for future
# usage. Add the following lines to your .Rprofile:
##
lib <- ifelse(.Machine$sizeof.pointer==4,"~/R/library","~/R/library64")
options(refreshLibrary=lib)
.libPaths(c(lib,.libPaths()))
options(refreshSource=c("~/R/iDevel"))
##
# Then it is easy to refresh the package:
##

refresh("roadrunner")

# or even without quotes

refresh(roadrunner)


##
# If the refresh failes, you may want to start investigating
# why by telling 'refresh' be more talkative 
##
refresh(roadrunner,verbose=2)

# and by calling 'Source' which runs all R-files of the package
# via 'source(filename)'

Source(roadrunner)
## End(Not run)

tagteam/Refresh documentation built on June 14, 2021, 5:17 p.m.