RCode
RCode[code]
a container used by RLink to represent pieces of R code corresponding to R objects not directly supported by RLink.
更多信息和选项
- The code parameter is a string of R code which, when parsed and evaluated, would normally (but not always) produce an object in R workspace equivalent to the one represented by this code. This string is obtained by applying an R deparse function to the original R object being imported in Mathematica.
- RLink does not guarantee that all objects imported into a Mathematica session and represented by RCode[code] will result in identical objects created in R workspace if exported back into R (from Mathematica). Therefore, generally RCode provides a form of representation for such objects, but not a form of equivalence.
- RLink does not guarantee that larger objects containing elements represented by RCode will be correctly exported from Mathematica to R.
- Expressions with an RCode head transform trivially (are left unchanged) by the functions ToRForm and FromRForm.
范例
基本范例 (1)
This creates a simple linear model:
The result is a rather complex R object:
It contains certain elements that are not directly supported by RLink, particularly formulas and unevaluated R code:
Some of these elements are parts of the object's attributes rather than the object's data. These are the attributes of the linear model R object:
文本
Wolfram Research (2012),RCode,Wolfram 语言函数,https://reference.wolfram.com/language/RLink/ref/RCode.html.
CMS
Wolfram 语言. 2012. "RCode." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/RLink/ref/RCode.html.
APA
Wolfram 语言. (2012). RCode. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/RLink/ref/RCode.html 年