Repository navigation
Load example data in one click - #26
Merged
Merged
Conversation
The Data Upload tab has a "Try with example data" button loading five predictors and a reproducible sample of 1,500 Niakhar occurrences of Faidherbia albida, so the workflow can be explored without one's own files. The R-Code tab rebuilds them with system.file(), so the script runs on any machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # NEWS.md
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
sdmApp is aimed at users with little R experience, but its first screen asked them to find raster files and an occurrence table before they could see anything. The package already ships example data: the Niakhar survey of Faidherbia albida and its predictors. They were only reachable by browsing the file choosers' "Examples" folder and loading the rasters and the table in two separate steps, with the right separator settings.
This PR adds a "Try with example data" button at the top of the Data Upload tab.
What it loads
bio1,bio4,bio12,bio15andElev(temperature, rainfall and elevation).set.seed(1)) of 1,500 of the 9,258 Niakhar presence/absence points, with the coordinate and species columns already set. The sample keeps the demo responsive, since all points make random forests and tuning slow.Portable script
The R-Code tab writes the example with
system.file("extdata", ..., package = "sdmApp")and the same seeded sample, never this machine's library path, so the generated script and HTML report run on any computer. Its checklist shows "example data".Validation
system.file()and contains no library path, then runs the script. It rebuilds the same 1,500 points and identical fold metrics.Testing
test-app-script.R: new example-data test.lintr::lint_package(): no lints.spelling: no errors.devtools::test(): 103 tests, 527 expectations, 0 failed, 0 skipped. After mergingmaster(with Measure the spatial sorting bias of cross-validation folds #25) into the branch, the affected tests were run again and pass: 5 script tests and 3 sorting-bias tests.🤖 Generated with Claude Code