Package: magic 1.6-1-1

magic: Create and Investigate Magic Squares

A collection of functions for the manipulation and analysis of arbitrarily dimensioned arrays. The original motivation for the package was the development of efficient, vectorized algorithms for the creation and investigation of magic squares and high-dimensional magic hypercubes.

Authors:Robin K. S. Hankin [aut, cre]

magic_1.6-1-1.tar.gz
magic_1.6-1-1.zip(r-4.5)magic_1.6-1-1.zip(r-4.4)magic_1.6-1-1.zip(r-4.3)
magic_1.6-1-1.tgz(r-4.4-any)magic_1.6-1-1.tgz(r-4.3-any)
magic_1.6-1-1.tar.gz(r-4.5-noble)magic_1.6-1-1.tar.gz(r-4.4-noble)
magic_1.6-1-1.tgz(r-4.4-emscripten)magic_1.6-1-1.tgz(r-4.3-emscripten)
magic.pdf |magic.html
magic/json (API)
NEWS

# Install 'magic' in R:
install.packages('magic', repos = c('https://robinhankin.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/robinhankin/magic/issues

Datasets:

On CRAN:

11.18 score 3 stars 222 packages 408 scripts 19k downloads 4 mentions 106 exports 1 dependencies

Last updated 3 months agofrom:6b625572e0. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 26 2024
R-4.5-winOKOct 26 2024
R-4.5-linuxOKOct 26 2024
R-4.4-winOKOct 26 2024
R-4.4-macOKOct 26 2024
R-4.3-winOKOct 26 2024
R-4.3-macOKOct 26 2024

Exports:%eq%%ge%%gt%%le%%lt%%ne%adiagallsubhypercubesallsumsanother_incidenceanother_latinapadapldropapldrop<-apltakeapltake<-aplusarevarotarowas.standardashiftbernhardssonbernhardssonAbernhardssonBcilleruelocirculantdiag.offdo.indexeqfnsdforce.integergegthudsoninc_to_incincidenceis.2x2.correctis.alicehypercubeis.antimagicis.associativeis.bree.correctis.centrosymmetricis.circulantis.diagonally.correctis.hadamardis.heterosquareis.incidenceis.incidence.improperis.latinis.latinhypercubeis.magicis.magichypercubeis.mostperfectis.normalis.okis.pandiagonalis.panmagicis.perfectis.persymmetricis.samis.semimagicis.semimagic.defaultis.semimagichypercubeis.sparseis.square.palindromicis.stamis.standardis.standard.toroidalis.totally.antimagicis.totally.heterosquarelatinlelozengeltmagicmagic.2np1magic.4nmagic.4np2magic.8magic.constantmagic.primemagic.productmagic.product.fastmagiccube.2np1magichypercube.4nmagicplotminmaxnenotmagic.2npanmagic.4panmagic.4npanmagic.6nm1panmagic.6np1panmagic.6npm1panmagic.8processrecurserlatinsamshiftstracheysubsumssylvestertransfunincidence

Dependencies:abind

A vignette for the magic package

Rendered frommagic.Rnwusingutils::Sweaveon Oct 26 2024.

Last update: 2024-08-13
Started: 2022-02-07

Readme and manuals

Help Manual

Help pageTopics
Create and Investigate Magic Squaresmagic-package
Binds arrays corner-to-corneradiag
Subhypercubes of magic hypercubesallsubhypercubes
Row, column, and two diagonal sums of arraysallsums
Pad arraysapad
Replacements for APL functions take and dropapl apldrop apldrop<- apltake apltake<- take
Generalized array additionaplus
Reverses some dimensions; a generalization of revarev
Rotates an array about two specified dimensionsarot
Generalized row and colarow
Standard form for magic squaresas.standard is.standard is.standard.toroidal
A class of multiplicative magic squares due to Cilleruelo and Lucacilleruelo
Circulant matrices of any ordercirculant is.circulant
A pantriagonal magic cubecube2
Extracts broken diagonalsdiag.off
Apply a function to array element indicesdo.index
Comparison of two magic squares%eq% %ge% %gt% %le% %lt% %ne% eq ge gt le lt ne
First non-singleton dimensionfnsd
Integerize array elementsforce.integer
A perfect magic cube due to FrankensteinFrankenstein
Hadamard matriceshadamard is.hadamard sylvester
A perfect magic cube due to Hendrickshendricks
Pandiagonal magic squares due to Hudsonhudson
Various tests for the magicness of a squareis.2x2.correct is.antimagic is.associative is.bree.correct is.heterosquare is.latin is.magic is.mostperfect is.normal is.pandiagonal is.panmagic is.regular is.sam is.semimagic is.semimagic.default is.sparse is.stam is.totally.antimagic is.totally.heterosquare is.ultramagic
magic hypercubesis.alicehypercube is.diagonally.correct is.latinhypercube is.magichypercube is.nasik is.perfect is.semimagichypercube
does a vector have the sum required to be a row or column of a magic square?is.ok
Is a square matrix square palindromic?is.centrosymmetric is.persymmetric is.square.palindromic
Random latin squaresanother_incidence another_latin incidence inc_to_inc is.incidence is.incidence.improper latin rlatin unincidence
Conway's lozenge algorithm for magic squareslozenge
Creates magic squaresmagic
Magic squares of odd ordermagic.2np1
Magic squares of order 4nmagic.4n
Magic squares of order 4n+2magic.4np2
Regular magic squares of order 8magic.8
Magic constant of a magic square or hypercubemagic.constant
Magic squares prime ordermagic.prime
Product of two magic squaresmagic.product magic.product.fast
Magic cubes of order 2n+1magiccube.2np1
Magic cubes of order 3magiccubes
Magic hypercubes of order 4nmagichypercube.4n
Joins consecutive numbers of a magic square.magicplot
are all elements of a vector identical?minmax
An unmagic squarenotmagic.2n
N queens problembernhardsson bernhardssonA bernhardssonB nqueens
A most perfect square due to OllerenshawOllerenshaw
Panmagic squares of order 4panmagic.4
Panmagic squares of order 4n, 6n+1 and 6n-1panmagic.4n panmagic.6nm1 panmagic.6np1 panmagic.6npm1
Panmagic squares of order 8panmagic.8
A perfect magic cube of order 5perfectcube5
A perfect cube of order 6perfectcube6
Force index arrays into rangeprocess
Recursively apply a permutationrecurse
Sparse antimagic squaressam
Shift origin of arrays and vectorsashift shift
Strachey's algorithm for magic squaresstrachey
Sums of submatricessubsums
Frenicle's equivalent magic squarestransf