Repository navigation
Conversation
Replace the hard-coded "Y:/Logiciels/TauArgus/TauArgus.exe" default with: - the TAUARGUS_EXE environment variable, typically set in .Renviron; - new exported helpers set_tauargus_exe() (session or .Renviron with install = TRUE) and get_tauargus_exe(); - automatic detection when not set (PATH, then "Argus" folders in the usual install locations, most recent version first); - an interactive file chooser in run_arb() when Tau-Argus still cannot be found, with an offer to save the choice in .Renviron. Update the startup message, run_arb() errors, docs, README, NEWS and vignettes (no more user-specific paths; setup chunks are eval = FALSE so precompilation uses the maintainer's own TAUARGUS_EXE). Also fix a broken chunk fence in protect_multi_tables_fr that rendered a whole section as raw code. Re-render the affected HTML vignettes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Shared check (non-empty, exists, not a folder) used by run_arb(), get_tauargus_exe() and the startup message; folders get an explicit error suggesting the TauArgus.exe path inside. - set_tauargus_exe() stops on a missing file or a folder instead of warning; check = FALSE stores the path anyway (e.g. network drive). - If TAUARGUS_EXE points to a missing file, fall back to auto-detection with a message explaining how to update it; if nothing is detected, keep the stored path so errors and the file chooser refer to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The package currently initialises
rtauargus.tauargus_exetoY:/Logiciels/TauArgus/TauArgus.exe, a path that only exists on INSEE workstations, and the vignettes and examples hard-code that folder layout. This PR replaces it with a configuration approach similar to how API keys are usually handled in R packages (e.g.tidycensus::census_api_key()).How the location of Tau-Argus is now found
TAUARGUS_EXEenvironment variable, typically set once in.Renviron.TAUARGUS_EXEentry in the user.Renvironfile (useful if it was added during the current session).TauArguson thePATH, thenTauArgus.exeinside folders whose name contains "Argus" (up to three levels deep) in the usual locations: Program Files,%LOCALAPPDATA%, the user folder and its Downloads folder, and the root of the system drive. If several versions are found, the highest version number in the path wins. The search takes a few hundredths of a second.run_arb()still cannot find Tau-Argus in an interactive session, a file chooser opens (RStudio's if available, otherwise the Windows dialog orfile.choose()) and the user is asked whether to save the choice in.Renviron. Non-interactive sessions get an explicit error explaining how to set it.options(rtauargus.tauargus_exe = ...)and thetauargus_exeargument ofrun_arb()still work as before.New exported functions
set_tauargus_exe(path, install = FALSE, overwrite = FALSE, check = TRUE): sets the location for the session, or saves it in.Renvironwithinstall = TRUE(a.Renviron.bakbackup is made first).get_tauargus_exe(detect = TRUE): returns the location currently in use.Validation
file.exists()alone also accepts folders). A folder gets an explicit error suggesting theTauArgus.exepath inside it.set_tauargus_exe()stops on a missing file or a folder (check = FALSEstores it anyway, e.g. for a network drive that is not connected yet).TAUARGUS_EXEpoints to a file that no longer exists (e.g. after upgrading Tau-Argus), the automatic search is used instead, with a message explaining how to update it.Documentation and vignettes
run_arb()errors,?rtauargus_options,?run_arb, README, NEWS and the\dontrun{}examples now useset_tauargus_exe("C:/path/to/TauArgus/TauArgus.exe")instead of theY:/path..Rmd.origand precompiled.Rmd) describe the new setup, and the affected HTML vignettes are re-rendered..Rmd.origfiles are noweval = FALSE, soprecompilation.Ruses the maintainer's ownTAUARGUS_EXE(set it in.Renvironbefore precompiling) rather than a placeholder path.protect_multi_tables_fr, which made a whole section ("Comment protéger 4 tableaux liés en même temps") render as raw code.Dependencies
rstudioapi(file chooser in RStudio) andwithr(test cleanup) are added toSuggests.Tests
New
tests/testthat/test_tauargus_exe.R(38 expectations) covering detection, version ordering, priority order, stale paths, folder rejection,.Renvironwriting/overwrite, and the interactive prompt (mocked). The full test suite passes.Note
This overlaps with files touched by #69 (documentation cleanup), so whichever is merged second will likely need a rebase. Happy to rebase this one if #69 goes in first.
🤖 Generated with Claude Code