|
44 | 44 |
|
45 | 45 | - Misc |
46 | 46 |
|
| 47 | + - Packages |
| 48 | + |
| 49 | + - [{]{style="color: #990000"}[fs](https://fs.r-lib.org/){style="color: #990000"}[}]{style="color: #990000"} - A cross-platform, uniform interface to file system operations |
| 50 | + - Navarro deep dive, [For fs](https://blog.djnavarro.net/posts/2024-10-06_fs/) |
| 51 | + - [{]{style="color: #990000"}[littler](https://eddelbuettel.github.io/littler/){style="color: #990000"}[}]{style="color: #990000"} - A scripting and command-line front-end for GNU R |
| 52 | + - [{]{style="color: #990000"}[ps](https://ps.r-lib.org/index.html){style="color: #990000"}[}]{style="color: #990000"} - List, Query, Manipulate System Processes |
| 53 | + - [{]{style="color: #990000"}[rapp](https://github.com/r-lib/Rapp){style="color: #990000"}[}]{style="color: #990000"} - Package for building a polished CLI application from a simple R script |
| 54 | + - An alternative front end to R, a drop-in replacement for Rscript that automatically parses command line arguments into R values |
| 55 | + - [{]{style="color: #990000"}[seekr](https://cran.r-project.org/web/packages/seekr/index.html){style="color: #990000"}[}]{style="color: #990000"} - Recursively list files from a directory, filter them using a regular expression, read their contents, and extract lines that match a user-defined pattern |
| 56 | + - Designed for quick code base exploration, log inspection, or any use case involving pattern-based file and line filtering. |
| 57 | + - [{]{style="color: #990000"}[sessioncheck](https://sessioncheck.djnavarro.net/){style="color: #990000"}[}]{style="color: #990000"} - Provides simple tools that can be called at the top of a script, and produce warnings or errors if it detects signs that the script is not being executed in a clean R session. |
| 58 | + - The intended user for sessioncheck is a beginner or intermediate level R user who needs a drop-in replacement for the simple but unsafe method of calling `rm(list = ls())` at the top of the script |
| 59 | + - Gaining the habit of restarting the R session is best when iterating or running a new script, but I guess beginning level programmers don't do this. |
| 60 | + - The only thing that `rm(list = ls())` does is remove *objects* from the global environment. This gives the user the false sense of confidence that their R session is "clean," even although in most cases it is sufficient |
| 61 | + - e.g. doesn't remove attached packages |
| 62 | + - [{]{style="color: #990000"}[sys](https://jeroen.r-universe.dev/sys){style="color: #990000"}[}]{style="color: #990000"} - Offers drop-in replacements for the `system2` with fine control and consistent behavior across platforms |
| 63 | + - Supports clean interruption, timeout, background tasks, and streaming STDIN / STDOUT / STDERR over binary or text connections. |
| 64 | + - Arguments on Windows automatically get encoded and quoted to work on different locales. |
| 65 | + |
| 66 | + - Resources |
| 67 | + |
| 68 | + - [Invoking R from the command line](https://colinfay.me/intro-to-r/appendix-b-invoking-r.html) for using `R` and `R CMD` |
| 69 | + |
47 | 70 | - The "shebang" line starting `#!` allows a script to be run directly from the command line without explicitly passing it through `Rscript` or `r`. It's not required but is a helpful convenience on Unix-like systems. |
48 | 71 |
|
49 | 72 | ``` r |
|
82 | 105 | 3. Inside folder add a batch script to launch R with --no-save arg |
83 | 106 | 4. Add folder to path |
84 | 107 |
|
85 | | -- Resources |
86 | | - |
87 | | - - [Invoking R from the command line](https://colinfay.me/intro-to-r/appendix-b-invoking-r.html) for using `R` and `R CMD` |
88 | | - |
89 | | -- Packages |
90 | | - |
91 | | - - [{]{style="color: #990000"}[ps](https://ps.r-lib.org/index.html){style="color: #990000"}[}]{style="color: #990000"} - List, Query, Manipulate System Processes |
92 | | - - [{]{style="color: #990000"}[fs](https://fs.r-lib.org/){style="color: #990000"}[}]{style="color: #990000"} - A cross-platform, uniform interface to file system operations |
93 | | - - Navarro deep dive, [For fs](https://blog.djnavarro.net/posts/2024-10-06_fs/) |
94 | | - - [{]{style="color: #990000"}[littler](https://eddelbuettel.github.io/littler/){style="color: #990000"}[}]{style="color: #990000"} - A scripting and command-line front-end for GNU R |
95 | | - - [{]{style="color: #990000"}[rapp](https://github.com/r-lib/Rapp){style="color: #990000"}[}]{style="color: #990000"} - Package for building a polished CLI application from a simple R script |
96 | | - - An alternative front end to R, a drop-in replacement for Rscript that automatically parses command line arguments into R values |
97 | | - - [{]{style="color: #990000"}[sys](https://jeroen.r-universe.dev/sys){style="color: #990000"}[}]{style="color: #990000"} - Offers drop-in replacements for the `system2` with fine control and consistent behavior across platforms |
98 | | - - Supports clean interruption, timeout, background tasks, and streaming STDIN / STDOUT / STDERR over binary or text connections. |
99 | | - - Arguments on Windows automatically get encoded and quoted to work on different locales. |
100 | | - - [{]{style="color: #990000"}[seekr](https://cran.r-project.org/web/packages/seekr/index.html){style="color: #990000"}[}]{style="color: #990000"} - Recursively list files from a directory, filter them using a regular expression, read their contents, and extract lines that match a user-defined pattern |
101 | | - - Designed for quick code base exploration, log inspection, or any use case involving pattern-based file and line filtering. |
102 | | - |
103 | 108 | - File Paths |
104 | 109 |
|
105 | 110 | - Various functions to make file paths easier to work with ([source](https://bsky.app/profile/randvegan.bsky.social/post/3lllsqh33b22p)) |
|
357 | 362 | - Linux utilities through Python in CLI\ |
358 | 363 |
|
359 | 364 | | Command | Purpose | More | |
360 | | - |----|----|----| |
| 365 | + |------------------------|------------------------|------------------------| |
361 | 366 | | `python3.12 -m uuid` | Like `uuidgen` CLI utility | [Docs](https://docs.python.org/3/library/uuid.html#command-line-usage) | |
362 | 367 | | `python3.12 -m sqlite3` | Like `sqlite3` CLI utility | [Docs](https://docs.python.org/3/library/sqlite3.html#command-line-interface) | |
363 | 368 | | `python -m zipfile` | Like `zip` & `unzip` CLI utilities | [Docs](https://docs.python.org/3/library/zipfile.html#command-line-interface) | |
|
375 | 380 | - Code Utilities\ |
376 | 381 |
|
377 | 382 | | Command | Purpose | More | |
378 | | - |----|----|----| |
| 383 | + |------------------------|------------------------|------------------------| |
379 | 384 | | `python -m pip` | Install third-party Python packages | [Docs](https://docs.python.org/3/installing/index.html) | |
380 | 385 | | `python -m venv` | Create a virtual environment | [Docs](https://docs.python.org/3/library/venv.html) | |
381 | 386 | | `python -m pdb` | Run the Python Debugger | [Docs](https://docs.python.org/3/library/pdb.html) | |
|
0 commit comments