% Generated by roxygen2: do not edit by hand % Please edit documentation in R/docs.R \name{FAQ} \alias{FAQ} \title{Frequently Asked Questions} \description{ Please take a look at this list before asking questions. } \section{Package installation}{ \subsection{How do I reinstall a package?}{ pak does not reinstall a package, if the same version is already installed. Sometimes you still want a reinstall, e.g. to fix a broken installation. In this case you can delete the package and then install it, or use the \code{?reinstall} parameter: \if{html}{\out{
    }}\preformatted{pak::pkg_install("tibble")
    }\if{html}{\out{
}}\if{html}{\out{

    #>
    #> → Will install 13 packages.
    #> → All 13 packages (7.68 MB) are cached.
    #> + cli         3.3.0
    #> + crayon      1.5.1
    #> + ellipsis    0.3.2
    #> + fansi       1.0.3
    #> + glue        1.6.2
    #> + lifecycle   1.0.1
    #> + magrittr    2.0.3
    #> + pillar      1.7.0
    #> + pkgconfig   2.0.3
    #> + rlang       1.0.2
    #> + tibble      3.1.7
    #> + utf8        1.2.2
    #> + vctrs       0.4.1
    #> i No downloads are needed, 13 pkgs (7.68 MB) are cached
    #> v Got utf8 1.2.2 (aarch64-apple-darwin20) (209.24 kB)
    #> v Installed cli 3.3.0  (76ms)
    #> v Installed crayon 1.5.1  (87ms)
    #> v Installed ellipsis 0.3.2  (97ms)
    #> v Installed fansi 1.0.3  (103ms)
    #> v Installed glue 1.6.2  (111ms)
    #> v Installed lifecycle 1.0.1  (153ms)
    #> v Installed magrittr 2.0.3  (158ms)
    #> v Installed pillar 1.7.0  (162ms)
    #> v Installed pkgconfig 2.0.3  (87ms)
    #> v Installed rlang 1.0.2  (39ms)
    #> v Installed tibble 3.1.7  (41ms)
    #> v Installed utf8 1.2.2  (39ms)
    #> v Installed vctrs 0.4.1  (32ms)
    #> v 1 pkg + 12 deps: added 13, dld 1 (209.24 kB) [1.8s]

}} \if{html}{\out{
    }}\preformatted{pak::pkg_install("tibble?reinstall")
    }\if{html}{\out{
}}\if{html}{\out{

    #>
    #> → Will install 1 package.
    #> → The package (724.32 kB) is cached.
    #> + tibble   3.1.7
    #> i No downloads are needed, 1 pkg (724.32 kB) is cached
    #> v Installed tibble 3.1.7  (42ms)
    #> v 1 pkg + 12 deps: kept 11, added 1 [343ms]

}} } \subsection{How do I install a dependency from a binary package}{ Sometimes it is sufficient to install the binary package of an older version of a dependency, instead of the newer source package that potentially needs compilers, system tools or libraries. \code{pkg_install()} and \code{lockfile_create()} default to \code{upgrade = FALSE}, which always chooses binaries over source packages, so if you use \code{pkg_install()} you don't need to do anything extra. The \verb{local_install_*} functions default to \code{upgrade = TRUE}, as does \code{pak()} with \code{pkg = NULL}, so for these you need to explicitly use \code{upgrade = FALSE}. } \subsection{How do I install a package from source?}{ To force the installation of a source package (instead of a binary package), use the \code{?source} parameter: \if{html}{\out{
    }}\preformatted{pak::pkg_install("tibble?source")
    }\if{html}{\out{
}}\if{html}{\out{

    #>
    #> → Will install 1 package.
    #> → The package (672.34 kB) is cached.
    #> + tibble   3.1.7 👷🏼‍♀️🔧
    #> i No downloads are needed, 1 pkg (672.34 kB) is cached
    #> i Building tibble 3.1.7
    #> v Built tibble 3.1.7 (3.1s)
    #> v Installed tibble 3.1.7  (35ms)
    #> v 1 pkg + 12 deps: kept 11, added 1 [4.1s]

}} } \subsection{How do I install the latest version of a dependency?}{ If you want to always install a dependency from source, because you want the latest version or some other reason, you can use the \code{source} parameter with the \verb{=} form: \verb{=?source}. For example to install tibble, with its cli dependency installed from source you could write: \if{html}{\out{
    }}\preformatted{pak::pkg_install(c("tibble", "cli=?source"))
    }\if{html}{\out{
}}\if{html}{\out{

    #>
    #> → Will install 1 package.
    #> → The package (540.04 kB) is cached.
    #> + cli   3.3.0 👷🏽🔧
    #> i No downloads are needed, 1 pkg (540.04 kB) is cached
    #> i Building cli 3.3.0
    #> v Built cli 3.3.0 (4.5s)
    #> v Installed cli 3.3.0  (68ms)
    #> v 1 pkg + 12 deps: kept 11, added 1 [4.9s]

}} } \subsection{How do I ignore an optional dependency?}{ \if{html}{\out{
    }}\preformatted{pak::pkg_install(
      c("tibble", "DiagrammeR=?ignore", "formattable=?ignore"),
      dependencies = TRUE
    )
    }\if{html}{\out{
}}\if{html}{\out{

    #>
    #> i No downloads are needed
    #> v 1 pkg + 12 deps: kept 12 [583ms]

}} The syntax is \if{html}{\out{
    }}\preformatted{=?ignore
    }\if{html}{\out{
}} Note that you can only ignore \emph{optional} dependencies, i.e. packages in \code{Suggests} and \code{Enhances}. } } \section{Others}{ \subsection{How can I use pak with renv?}{ Since version 1.0.0 renv has official support for using pak. This needs to be enabled with the \code{renv.config.pak.enabled} option or the \code{RENV_CONFIG_PAK_ENABLED} environment variable set to \code{TRUE}. For more information see the renv \href{https://rstudio.github.io/renv/reference/config.html?q=pak#renv-config-pak-enabled}{documentation}. } }