Description Usage Arguments Value Examples
Write a Macaulay2 file, evaluate it through a back-end connection to Macaulay2, and bring the output back into R.
1 |
code |
Macaulay2 code as either a character string or function; see examples |
dir |
directory to place the files in |
opts |
options for m2 |
an object of class m2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## Not run:
options(digits = 20)
13^20
m2("13^20") # correct answer
m2("toRR(20,(19004963774880800571392-13^20)/13^20)") # relative error
options(digits = 7)
code <- "
1+1
2+3
100!
R = QQ[x,y,z]
(x+y)^10
curve = ideal( x^4-y^5, x^3-y^7 )
gens gb curve
m = matrix {{x^2, x^2-y^2, x*y*z^7 }}
image m
R = QQ[a..d]
I = ideal(a^3-b^2*c, b*c^2-c*d^2, c^3)
G = gens gb I
G
"
m2(code)
code <- "
R = QQ[x,y,z,t]
I = ideal( t^4 - x, t^3 - y, t^2 - z)
gens gb I
"
m2(code)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.