MyNixOS website logo
Description

Shortcuts for File Creation with Informative Prefixes.

Provides functions for quickly creating R and Python scripts, as well as 'Rmarkdown' or Quarto documents with automatically assigned name prefixes. Prefixes are either file counts (e.g. "001") or dates (e.g. "2022-09-26").

Organizr: Tidy up your projects for good!

R-CMD-check

Organizr provides opinionated code-shortcuts to quickly create R scripts, as well as minimal Quarto and Rmarkdown documents with a consistent naming scheme.

Organizr offers a count-based prefix...

R/
  001_first-script.R
  002_another-script.R
  003_and-so-on.R

... and a date-based prefix.

R/
  2022-09-24_first-script.R
  2022-09-26_another-script.R
  2022-09-26_and-so-on.R

Installation

You can install the development version of organizr like so:

# install.packages("devtools") # if you do not have devtools installed
devtools::install_github("jobrachem/organizr")

Some details

Organizr offers the four following functions:

  • r() creates an R script with a timestamp in project_path/R.
  • py() creates a Python script with a timestamp in project_path/py.
  • qmd() creates a minimal Quarto document in project_path/qmd.
  • rmd() creates a minimal Quarto document in project_path/rmd.

Organizr is an opinionated packaged. It may very well be that it does not fit your personal workflow, and that's ok.

Setup

The best user experience arises, if you load organizr in the .Rprofile of your current project. To do so, you can use the following line to open your project's .Rprofile:

# install.packages("usethis")
usethis::edit_r_profile(scope = "project")

Then place the following code inside the .Rprofile:

if (interactive()) {
  suppressMessages(require(organizr))
}

This will always load up the library organizr in interactive R sessions. Now, you will always be able to create consistently named new R scripts via quick and simple function calls like

r("my-script")

If this is the first R file in your project, this function call will create the file 001_my-script.R in the directory project_path/R.

Options

You can set some global options via

options("option_name" = "option_value")

If you want to use options, it often makes sense to also place them directly in the .Rprofile file.

Example:

With this function call, you set the default prefix used by organizr to "date":

options("organizr.prefix_by" = "date")

General options:

OptionMeaning
organizr.prefix_delimWhich character to insert as a separator between the prefix and the actual file name. The default is "_"
organizr.prefix_byCan be used to override the function default of "count". Can be "count" or "date".
organizr.prefix_date_formatDate format for date prefixes. Can be any format string accepted by strftime. Default is "%Y-%m-%d".

Options for R scripts:

OptionMeaning
organizr.r.init_with_dateCan be set to FALSE to turn off the inclusion of the timestamp comment at the top of the script.
organizr.r.date_formatDate format for R and Python script timestamp comment. Can be any format string accepted by strftime. Default is "%Y-%m-%d %H:%M".
organizr.r.directoryThe directory in which the scripts should be place (relative to the project directory)

Options for Python scripts:

OptionMeaning
organizr.py.init_with_dateCan be set to FALSE to turn off the inclusion of the timestamp comment at the top of the script.
organizr.py.date_formatDate format for R and Python script timestamp comment. Can be any format string accepted by strftime. Default is "%Y-%m-%d %H:%M".
organizr.py.directoryThe directory in which the scripts should be place (relative to the project directory)

Other options:

OptionMeaning
organizr.rmd.directoryThe directory in which .Rmd files should be place (relative to the project directory)
organizr.qmd.directoryThe directory in which .qmd files should be place (relative to the project directory)
Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows