The functions that write into a project – the renders, the submissions,
convert_data() and the rest – write into the one you name: here, once a
session, or with path in each call. easypaper never takes the working
directory for it: with neither, a function that writes stops before
writing anything. The functions that only read, such as
check_citations() or manuscript_stats(), use the project named here
too, and otherwise the one the working directory is in.
Details
Once the project's .Rproj is open, the working directory is its root, so
set_paper(".") names it. The project stays named until the session ends
or you name another; path in a call works on that project for that call
alone.
See also
get_paper(), which says which project is named, and
create_paper(), which makes one.
Examples
dir <- file.path(tempdir(), "my_paper")
create_paper(dir, git = FALSE)
#> Project created: /tmp/Rtmp92gqjt/my_paper
#> 1. open my_paper.Rproj
#> 2. library(easypaper)
#> 3. set_paper(".") # the project to work on, once a session
#> 4. render_html() # see ?render for every command
old <- set_paper(dir)
#> Working on /tmp/Rtmp92gqjt/my_paper
get_paper()
#> Working on /tmp/Rtmp92gqjt/my_paper
list_journals()
#> [1] "journal-of-ecology"
set_paper(old)
unlink(dir, recursive = TRUE)
