Package: this.path 2.5.0

Iris Simmons

this.path:Get Executing Script's Path

Determine the path of the executing script. Compatible with a few popular GUIs: 'Rgui', 'RStudio', 'VSCode', 'Jupyter', 'Emacs', and 'Rscript' (shell). Compatible with several functions and packages: 'source()', 'sys.source()', 'debugSource()' in 'RStudio', 'compiler::loadcmp()', 'utils::Sweave()', 'box::use()', 'knitr::knit()', 'plumber::plumb()', 'shiny::runApp()', 'package:targets', and 'testthat::source_file()'.

Authors:Iris Simmons

this.path_2.5.0.tar.gz
this.path_2.5.0.tar.gz(r-4.5-noble)this.path_2.5.0.tar.gz(r-4.4-noble)
this.path_2.5.0.tgz(r-4.4-emscripten)this.path_2.5.0.tgz(r-4.3-emscripten)
this.path.pdf |this.path.html
this.path/json (API)
NEWS

# Installthis.path in R:
install.packages('this.path',repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/arcadeantics/this.path/issues

92 exports 1.45 score 0 dependencies 3 dependents 1.6k downloads

Last updated 6 days agofrom:7647349d8c

Exports:asArgsbasename2check.dircheck.pathcheck.projdirname2env.direnv.hereenv.LINENOenv.pathenv.projextext<-FILEfileArgsfrom.shellgetinitwdhereiciinit.fileinitwdinside.sourceis.mainlast.conditionLINELINENOmake_fix_fileOS.typepath.functionspath.joinpath.splitpath.split.1path.unsplitprogArgsrel2env.dirrel2env.projrel2hererel2projrel2src.dirrel2src.projrel2sys.dirrel2sys.projrelpathremoveextreset.projreset.this.projset.env.pathset.gui.pathset.jupyter.pathset.src.pathset.sys.pathset.sys.path.functionset.sys.path.jupyterset.this.pathset.this.path.jupytershFILEsite.filesource.exprssplitextsrc.dirsrc.heresrc.LINENOsrc.pathsrc.projsys.dirsys.heresys.LINENOsys.pathsys.projSys.putenvsys.srcrefsys.whichesthis.dirthis.paththis.projthisPathNotExistsErrorthisPathNotFoundErrortry.env.pathtry.shFILEtry.src.pathtry.sys.pathtry.this.pathtryCatch2tryCatch3unset.sys.pathunset.this.pathwith_init.filewith_script_pathwith_site.filewith_sys.pathwithArgswrap.source

Dependencies:

Readme and manuals

Help Manual

Help pageTopics
Get Script's Paththis.path-package
Manipulate File Pathsbasename2 dirname2
Check 'this.path()' is Functioning Correctlycheck.dir check.path check.proj
Functions That Enhance the Use of Other Packagesmake_fix_file with_script_path
File Extensionsext ext<- removeext splitext
Construct Path to File, Starting With Script's Directoryhere ici reset.proj this.proj
Line Number of Executing ExpressionLINENO
Detect the Operating System TypeOS.type
Constructs Path Functions Similar to 'this.path()'path.functions
Construct Path to Filepath.join
Split File Path Into Individual Componentspath.split path.split.1 path.unsplit
Make a Path Relative to Anotherrel2here rel2proj relpath
Declare GUI's Active Documentset.gui.path thisPathNotExistsError thisPathNotFoundError
Declare Executing 'Jupyter' Notebook's Filenameset.jupyter.path
Implement 'this.path()' For Arbitrary 'source()'-Like Functionsset.env.path set.src.path set.sys.path set.sys.path.function unset.sys.path with_sys.path wrap.source
Get 'FILE' Provided to R by a ShellshFILE
Files Related to Initialization of the R Sessioninit.file site.file with_init.file with_site.file
Determine Script's Filenamethis.dir this.path
Attempt to Determine Script's Filenametry.shFILE try.this.path