here/ 0000755 0001762 0000144 00000000000 13765341372 011210 5 ustar ligges users here/NAMESPACE 0000644 0001762 0000144 00000000173 13754236603 012426 0 ustar ligges users # Generated by roxygen2: do not edit by hand export(dr_here) export(here) export(i_am) export(set_here) import(rprojroot) here/LICENSE 0000644 0001762 0000144 00000000052 13754142277 012213 0 ustar ligges users YEAR: 2020 COPYRIGHT HOLDER: here authors here/README.md 0000644 0001762 0000144 00000007077 13754151765 012505 0 ustar ligges users # here [](https://www.tidyverse.org/lifecycle/#stable) [](https://github.com/r-lib/here/actions) [](https://CRAN.R-project.org/package=here) [](https://codecov.io/gh/r-lib/here?branch=master) The goal of the here package is to enable easy file referencing in [project-oriented workflows](https://rstats.wtf/project-oriented-workflow.html). In contrast to using [`setwd()`](https://rdrr.io/r/base/getwd.html), which is fragile and dependent on the way you organize your files, here uses the top-level directory of a project to easily build paths to files. ## Installation Install the released version of here from CRAN:
install.packages("here")## Usage The here package creates paths relative to the top-level directory. The package displays the top-level of the current project on load or any time you call `here()`:
here::i_am("README.Rmd") #> here() starts at /home/kirill/git/R/here here() #> [1] "/home/kirill/git/R/here"You can build a path relative to the top-level directory in order to read or write a file:
here("inst", "demo-project", "data", "penguins.csv") #> [1] "/home/kirill/git/R/here/inst/demo-project/data/penguins.csv" readr::write_csv(palmerpenguins::penguins, here("inst", "demo-project", "data", "penguins.csv"))These relative paths work regardless of where the associated source file lives inside your project, like analysis projects with data and reports in different subdirectories. See the included [demo project](https://github.com/r-lib/here/tree/master/inst/demo-project) for an example.  *Illustration by [Allison Horst](https://github.com/allisonhorst)* ------------------------------------------------------------------------ ## Code of Conduct Please note that the here project is released with a [Contributor Code of Conduct](https://here.r-lib.org/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. here/man/ 0000755 0001762 0000144 00000000000 13754151372 011760 5 ustar ligges users here/man/dr_here.Rd 0000644 0001762 0000144 00000001030 13754151372 013651 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/dr_here.R \name{dr_here} \alias{dr_here} \title{Situation report} \usage{ dr_here(show_reason = TRUE) } \arguments{ \item{show_reason}{\verb{[logical(1)]}\cr Include reason in output of \code{dr_here()}, defaults to \code{TRUE}.} } \description{ \code{dr_here()} shows a message that by default also includes the reason why \code{here()} is set to a particular directory. Use this function if \code{here()} gives unexpected results. } \examples{ dr_here() } here/man/here.Rd 0000644 0001762 0000144 00000004415 13754151372 013176 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/here.R \name{here} \alias{here} \title{Find your files} \usage{ here(...) } \arguments{ \item{...}{\verb{[character]}\cr Path components below the project root, can be empty. Each argument should be a string containing one or more path components separated by a forward slash \code{"/"}.} } \description{ \code{here()} uses a reasonable heuristics to find your project's files, based on the current working directory at the time when the package is loaded. Use it as a drop-in replacement for \code{\link[=file.path]{file.path()}}, it will always locate the files relative to your project root. } \details{ This package is intended for interactive use only. Use \code{\link[rprojroot:root_criterion]{rprojroot::has_file()}} or the other functions in the \pkg{rprojroot} package for more control, or for package development. If \code{here()} raises an error or otherwise behaves unexpectedly, you may have attached \pkg{plyr} or another package after \pkg{here}. Correct this using \href{https://conflicted.r-lib.org/}{the \pkg{conflicted} package}, or use \code{here::here("data", "df.rda")}. } \examples{ here() \dontrun{ here("some", "path", "below", "your", "project", "root.txt") here("some/path/below/your/project/root.txt") } } \section{Project root}{ The project root is established with a call to \verb{here::}\code{\link[=i_am]{i_am()}}. Although not recommended, it can be changed by calling \code{here::i_am()} again. In the absence of such a call (e.g. for a new project), starting with the current working directory during package load time, the directory hierarchy is walked upwards until a directory with at least one of the following conditions is found: \itemize{ \item contains a file \code{.here} \item contains a file matching \verb{[.]Rproj$} with contents matching \verb{^Version: } in the first line \item contains a file \code{DESCRIPTION} with contents matching \verb{^Package: } \item contains a file \code{remake.yml} \item contains a file \code{.projectile} \item contains a directory \code{.git} \item contains a file \code{.git} with contents matching \verb{^gitdir: } \item contains a directory \code{.svn} } In either case, \code{here()} appends its arguments as path components to the root directory. } here/man/set_here.Rd 0000644 0001762 0000144 00000002247 13754150007 014044 0 ustar ligges users % Generated by roxygen2: do not edit by hand % Please edit documentation in R/set_here.R \name{set_here} \alias{set_here} \title{Add a marker file to a project} \usage{ set_here(path = ".", verbose = TRUE) } \arguments{ \item{path}{\verb{[character(1)]}\cr Directory where to create \code{.here} file, defaults to the current directory.} \item{verbose}{\verb{[logical(1)]}\cr Verbose output, defaults to \code{TRUE}.} } \description{ \ifelse{html}{\out{