Skip to content

magicrect

1.0.0Package record

Construct Magic Rectangles and Nearly Magic Rectangles

0packages depend
513downloads / year
96.3%test coverage
13/13flavors OK

Overview

About

Constructs a magic rectangle or a nearly magic rectangle of order p x q for every order for which one exists, together with existence classification and verification utilities. A magic rectangle arranges the integers 1 to p*q so that all row sums are equal and all column sums are equal; it exists exactly when p and q have the same parity, excluding 2 x 2 and degenerate single-row/column cases (Hagedorn, 1999, doi:10.1016/S0012-365X(99)00041-2). When p and q have opposite parity a nearly magic rectangle exists instead, with constant sums along one direction and sums differing by at most one along the other (Chai, Singh and Stufken, 2019, Journal of Combinatorial Designs 27(6), 368-376). Implements the constructions of De Los Reyes, Das, Midha and Vellaisamy (2009) for even by even orders, Chai, Das and Midha (2013) for odd by odd orders, and Chai, Singh and Stufken (2019) for the nearly magic (even by odd) case.

Changes in 1.0.0
  • Initial release.
  • magic_rectangle(p, q) constructs a magic rectangle (p, q of equal parity; De Los Reyes et al. 2009 for even orders, Chai-Das-Midha 2013 for odd orders) or a nearly magic rectangle (opposite parity; Chai-Singh-Stufken 2019) for every order for which one exists.
  • rectangle_type(p, q) classifies existence ("magic", "nearly magic", "none").
  • verify_rectangle(M) checks the defining properties from first principles.
  • Exhaustive test suite over all orders up to 40 x 40.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 43 s · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK6 OK2026-07-20
Advisories

none known

Documentation

In release 1.0.0
READMEYes · 448 wordsVignettesNoNEWSYes · 67% structured · mentions 1.0.0Citation fileNoWebsiteYes
Help pages
3
Examples that run
100%3 run in a plain check
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
33%

Downloads

513
CRAN downloads in the past year
Rank #24,925 · ~1/day · ~43/mo
Daily download trend is not available in this view yet.
15630 days
45390 days
5131 year
Compare downloads with other packages →
Also on13 r2u2 autocran

Repository

0Stars
0Forks
0Open issues
0Open PRs
0Releases
Last activity 2026-07-11
Responsiveness
not measured
PracticesBeta

2 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/arijitray2/magic-rectangles on 2026-10-21.

Docs source (1)

GitHub Pages site last deployed 2026-07-11

CRAN release process (1)
cran-comments.md
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-07-10
    Commits: at least 6 crediting it in the message
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
0 external dependencies (excludes base and recommended)

Installing magicrect adds no packages beyond those that come with R.

Depends (0)
none
Imports (0)
none
LinkingTo (0)
none
Suggests (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 1.0.0 (2026)
Releases (1)
  • 1.0.0Latest
    2026-07-19 · current release
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-07-19
Total releases
1 / 1 yrs
License
MIT + file LICENSE OSI
Download size
8.8 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("magicrect")
Ray, A. (2026). magicrect: Construct Magic Rectangles and Nearly Magic Rectangles (Version 1.0.0) [Computer software]. https://doi.org/10.32614/CRAN.package.magicrect

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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for magicrect version 1.0.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy