Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An R package allowing here() roots to be temporarily relocated

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

torbjorn/wither

Repository files navigation

R-CMD-check

Run a block or expression temporarily under a differenthere() root.

This is useful if you need to source R code from another project forexample (as might be the case with git submodules)

Installation

You can install the development version of wither fromGitHub with:

# install.packages("pak")pak::pak("torbjorn/wither")

Example

with_here

with_here() evaluates an expression under a temporarily different hereroot():

library(here)library(wither)was<- here()d<- tempfile()dir.create(d)# have here() be somewhere else for an expressionis_now<- with_here(d, here())stopifnot(normalizePath(was)!= normalizePath(is_now))# clean upunlink(d,recursive=TRUE)

local_here

local_here() evaluates the remainder of a block under a temporarilydifferent here root():

library(here)library(wither)was<- here()d<- tempfile()dir.create(d)local({# have here() be somewhere else for the rest of the block    local_here(d)is_now<- here()    stopifnot(normalizePath(was)!= normalizePath(is_now))})# clean upunlink(d,recursive=TRUE)

About

An R package allowing here() roots to be temporarily relocated

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp