Learn R Programming

⚠️There's a newer version (0.2.0) of this package.Take me there.

whereami

The goal of whereami is to reliably find where command is run from.

Installation

remotes::install_github("yonicd/whereami")

Example

library(whereami)
library(ggplot2)

General

whereami()
#> ── Running From: Console ─────────────────────────

Plots


ggplot(iris) + 
  aes(x=Sepal.Length,y=Sepal.Width) + 
  geom_point() + 
  labs(caption = sprintf('sourced from: %s',whereami()))

Shiny

Non RStudio session

If you are running a non RStudio script ie from terminal R/Rscript then the package falls back to thisfile(), which has been migrated from rprojroot::thisfile().

In this case the traceback functionality of whereami() to return the line where the function was sourced is not enabled.

Copy Link

Version

Install

install.packages('whereami')

Monthly Downloads

288

Version

0.1.8.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jonathan Sidi

Last Published

May 5th, 2019

Functions in whereami (0.1.8.1)

cat_where

cat function for whereami
thisfile

Determines the path of the currently running script in terminal
whereami

Return where the script is run from
counter_state

whereami counter