Companion to "Learning Statistics with R"
Overview
A collection of tools intended to make introductory statistics easier to teach, including wrappers for common hypothesis tests and basic data manipulation. Accompanies the textbook "Learning Statistics with R: A Tutorial for Psychology Students and Other Beginners" by Navarro.
Bug fixes
correlate(): when a pair of variables had too few complete observations forcor.test()to run, the entire call would abort. The affected cell is now left asNAand the remaining pairs are computed normally.correlate(),goodnessOfFitTest(),associationTest(): the internaloptions(warn = 2)used to intercept warnings was not guarded withon.exit(), so an unexpected error could leave the session's global warn level permanently elevated. All three functions now useon.exit()to guarantee restoration.cramersV(): Yates' continuity correction was applied by default for 2×2 tables (inherited fromchisq.test()), causing V to be less than 1 even for perfectly associated tables. Cramér's V is now always computed from the Pearson chi-squared (no continuity correction), giving results on the correct 0-to-1 scale.
Show all changes in 1.0.0Hide the rest of the changes in 1.0.0
goodnessOfFitTest(),associationTest(): when a factor variable had unused levels, the extra levels were silently included in the test with zero observed cases, changing degrees of freedom and p-values without any indication. Both functions now issue an informative warning when unused levels are detected, with a suggestion to calldroplevels().modeOf(),maxFreq(): all-NAor zero-length input produced a cryptic base-R"no non-missing arguments to max"warning and returned empty output. Both functions now issue an informative warning and returnNA.wideToLong(): when no column names contained the separator string, the error came from deep insidestats::reshape()with no hint that the cause was a naming-convention mismatch. The function now checks for this condition early and stops with a plain-English message.importList(): passing an unnamed or partially-named list produced a cryptic"'names' must be a character vector"error from base R. The function now checks for missing names before proceeding and stops with an informative message. Passing an empty list now also produces a message rather than silently doing nothing.
Bug fixes
correlate(): when fewer than 2 numeric variables were present in the input, the function could iterate incorrectly due to1:(n-1)evaluating toc(1, 0)rather than an empty sequence. Fixed withseq_len(n-1).oneSampleTTest(): theconf.levelargument was not forwarded tostats::t.test(), so$conf.intalways contained the 95% interval regardless of what the user requested (#9).independentSamplesTTest(),pairedSamplesTTest(),associationTest(): passing a tibble asdatacaused spurious type-check failures. Fixed by coercingdatato a plain data frame on entry (#2).
Dependencies
tibbleandwithradded toSuggests(used in tests only).
---
From NEWS.md in the release
Install
Health
NOTER code for possible problemsr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64
Found calls to structure() using deprecated special names: lsr/tests/testthat/test-independentSamplesTTest.R (.Names: 1) lsr/tests/testthat/test-oneSampleTTest.R (.Names: 1) '.Names' should be changed to 'names'.
- NOTE8 OK, 5 NOTENow
- NOTE11 OK, 2 NOTE2026-07-16
- OK13 OK2026-07-15
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
The repository also keeps web-only articles.
- Help pages
- 32
- Examples that run
- 100%27 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 3%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 1,747
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
10 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/djnavarro/lsr on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-07-19 · The repository has a site deploy workflow
pkgdown site last built 2026-07-19
Show all practicesHide 1 practice
Dependencies
Installing lsr adds no packages beyond those that come with R.
Code & Tests
People & History
Maintainer since 0.1 (2011)
Pick two releases to compare their code metrics.
- 1.0.0Latest
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- 0.5.22021-12-01 · diff ↗
- 0.5.12021-09-20 · diff ↗
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- 0.52015-03-02 · diff ↗
Show 14 earlier eventsHide 14 earlier events
- RR 3.1.0 released · 2014-04-10
- 0.3.2
- 0.3.1
- 0.3
- 0.2.42013-06-13 · diff ↗
- 0.2.32013-04-19 · diff ↗
- RR 3.0.0 released · 2013-04-03
- 0.2.22013-01-15 · diff ↗
- 0.2.1
- 0.22012-11-14 · diff ↗ ·
removed 3 exports
wideToMV, longRM, wideRMadded 5 exports
permuteLevels, colCopy, rowCopy, expandFactors, xfun - RR 2.15.0 released · 2012-03-30
- 0.1.12012-01-23 · diff ↗
- 0.12011-12-11
- RR 2.14.0 released · 2011-10-31
Package metadata
- First published
- 2011-12-11
- Total releases
- 14 / 15 yrs
- License
- MIT + file LICENSE OSI · relicensed from GPL-3 in 0.5.1
- Download size
- 83 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("lsr")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.