Skip to content

Release 0.2.0: ploswater dataset and washdev update to mid-2026 - #21

Merged
larnsce merged 6 commits into
mainfrom
dev
Jul 23, 2026
Merged

Release 0.2.0: ploswater dataset and washdev update to mid-2026#21
larnsce merged 6 commits into
mainfrom
dev

Conversation

@larnsce

@larnsce larnsce commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #11, #13, #14, #17. Refs #12, #15, #16 (open until the review decisions on the das_type and country files land).

Test plan

larnsce and others added 6 commits July 8, 2026 09:36
- Manual supplement fix-ups now index uncnewsletter$paperid instead of
  washdev$paperid, so the curated values land on the intended rows
- The correspondence author country is cleaned into its own column
  instead of overwriting first_author_affiliation_country
- Repair Mac Roman bytes in raw washdev.csv cells at read time
  (openxlsx refused to export the invalid UTF-8)
- Regenerate data/*.rda and inst/extdata exports

Closes #13

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces the Python scrapers in inst/python/ with data-raw/washdev_scraping.R:

- chromote drives headless Chrome past the Cloudflare challenge (a plain
  user agent override suffices); rvest/xml2 parse the pages
- Incremental: reads data-raw/washdev.csv, scrapes only newer issues,
  and checkpoints the CSV after every issue
- Collects a new doi column from the citation_doi meta tag
- Mixed supplement types are recorded as ' & '-joined lists instead of
  'misc', removing the manual repair step for new rows
- Fixes the unreachable-code bug in the Python get_issues()

Validated field by field against the existing CSV row for paperid 93019
(all 20 metadata fields identical) and against the volume 13 issue 1
table of contents (6/6 paperids).

Closes #11

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The washdev scraper is now R (data-raw/washdev_scraping.R, #11) and
PLOS Water arrives via the API (data-raw/ploswater.R, #14), so the
Python stack is retired:

- 17 MB chromedriver binary plus its license files
- washdev_scraping.py (expired hardcoded cookies, Cloudflare-blocked)
  and washdev_scraping_selenium.py (superseded by the R port)
- uncnewsletter_scraping.py (candidate-URL collector for a newsletter
  that ceased publication in May 2024; recoverable from git history)
- data_processing.ipynb (superseded by data-raw/data_processing.R)
- empty requirements.txt

Also narrows .Rbuildignore: the ^inst rule excluded all of inst/ from
the built package, including inst/CITATION and inst/extdata.

Closes #17

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
data-raw/ploswater.R downloads all PLOS Water articles (436 since
volume 1, 2022) through the public search API and each article's JATS
XML, pure R with httr2 and xml2, no scraping:

- DAS text plus das_repo_url (URLs and dataset DOIs in the statement)
  and das_repo_name (recognized repositories: zenodo, dryad, figshare,
  osf, github, dataverse, and others)
- Supplementary materials with per-file types and stable download
  links (no expiring CDN signatures, unlike #10)
- First and correspondence author with affiliation, country, ORCID
- Subject terms as keywords (PLOS XML carries no author keywords)
- Resumable: skips DOIs already in data-raw/ploswater.csv

All 333 research articles carry a DAS; 177 articles link out to a
data location.

Refs #14

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
washdev: 241 new articles from volume 14 (2024) through volume 16
issue 6 (June 2026), now 1173 observations. All new rows carry DOIs.

ploswater: harmonized to the shared schema with paperid = DOI and
rule-based das_type classification; 320 of 333 statements classify by
rule, 13 stay NA pending review.

Unresolved values go to review files instead of hand edits, per the
reproducibility rule in #12:

- data-raw/washdev-das-review.csv (14) and washdev-country-review.csv (33)
- data-raw/ploswater-das-review.csv (13) and ploswater-country-review.csv (8)

Refs #12, #15

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- R/ploswater.R roxygen documentation and man/ploswater.Rd
- Dictionary rows for all 32 ploswater variables; washdev country
  variable names corrected from *_affiliation_region to
  *_affiliation_country; uncnewsletter issue_url entry fixed; doi and
  url_source documented for washdev
- README: three-dataset overview, ploswater section, dynamic washdev
  coverage line, uncnewsletter frozen-source note; rebuilt README.md
- DESCRIPTION: version 0.2.0, three datasets in the description
- NEWS.md entry for 0.2.0
- .Rbuildignore: replace the overly broad ^inst rule (this edit was
  described in the #17 cleanup commit but not included in it)

R CMD check: 0 errors, 0 warnings, 0 notes.

Refs #16

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port washdev scraper from Python/Selenium to R with incremental updates

1 participant