The capability of R to do symbolic mathematics is enhanced by the caracas package. This package uses the Python computer algebra library SymPy as a back-end but caracas is tightly integrated in the R environment. This enables the R user with symbolic mathematics within R at a high abstraction level rather than using text strings and text string manipulation as the case would be if using SymPy from R directly. We demonstrate how mathematics and statistics can benefit from bridging computer algebra and data via R. This is done thought a number of examples and we propose some topics for small student projects. The caracas package integrates well with e.g. Rmarkdown, and as such creation of scientific reports and teaching is supported.
翻译:R语言进行符号数学计算的能力通过caracas包得到增强。该包以Python计算机代数库SymPy为后端,但caracas紧密集成在R环境之中。这使得R用户能够在R中通过高抽象层级使用符号数学,而非像直接从R调用SymPy那样使用文本字符串及字符串操作。我们通过多个示例展示了数学与统计学如何受益于通过R语言搭建的计算机代数与数据之间的桥梁,并据此提出若干适合学生小项目的研究课题。caracas包能与Rmarkdown等工具良好集成,从而为科学报告撰写和教学工作提供支持。