Magic
create and investigate magic squares and magic hypercubes
Install / Use
/learn @RobinHankin/MagicREADME
Manipulation of high-dimensional arrays in R with the magic package
<!-- README.md is generated from README.Rmd. Please edit that file --> <img src="man/figures/magic.png" width = "150" align="right" /> <!-- badges: start --> <!-- badges: end -->Overview
The magic package implements functionality for manipulating high-dimensional arrays using efficient vectorised methods. The original application was high-dimensional magic hypercubes. This README shows some of the more useful functions in the package.
Installation
You can install the released version of magic from
CRAN with:
# install.packages("magic") # uncomment this to install the package
library("magic")
Package highlights
- Function
adiag()binds arbitrarily-dimensioned arrays corner-to-corner - Function
apad()pads arbitrarily-dimensioned arrays - Function
apldrop()is a replacement for APL’s drop - Function
aplus()superimposes two arrays of different dimensions and returns the sum of overlapping elements - Function
arev()is a multidimensional generalization ofrev() - Function
arot()is a generalization of matlab’srotdim - Function
fnsd()returns the first nonsingleton dimension of an arbitrary dimensioned array - Function
ashift()shifts the origin of arbitrary dimensioned arrays
Much of the package functionality is vectorised in array dimension.
Further information
For more detail, see the package vignette
vignette("magic")
Related Skills
node-connect
348.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
