RAttributes[atts]
an RLink container for attributes of R objects.
RAttributes
RAttributes[atts]
an RLink container for attributes of R objects.
更多信息和选项
- atts must be a sequence of zero, one, or more delayed rules, of the form name :> value, where name must be a string name of an attribute, and value can be any valid R object representation, which RLink can handle.
- RAttributes is not normally used as a standalone expression, but rather as a part of expressions with heads RVector or RList.
- For R vectors, the attribute dim is not included in RAttributes in the short form of R object representation, but is included in the long (full) form.
范例
基本范例 (3)
Needs["RLink`"]
InstallR[]This represents the full internal form of a matrix:
vecff = RVector["integer", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, RAttributes["dim" :> RVector["integer", {2, 5}, RAttributes[]]]]This is equivalent to the following short form:
FromRForm[vecff]The following expression represents the full internal form of an R vector with an additional names attribute:
vecAttff =
RVector["integer", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, RAttributes["dim" :> RVector["integer", {2, 5}, RAttributes[]],
"names" :> RVector["character", {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"}, RAttributes[]]
]]This is equivalent to the following short form:
FromRForm[vecAttff ]You can send this vector to R:
RSet["vecAtt", vecAttff ]This returns the attributes of the vector used above, fetched from R:
atts = REvaluate["attributes(vecAtt)"]Looking at the internal form of this answer, you can see that in R, attributes are stored in a list:
ToRForm[atts]技术笔记
文本
Wolfram Research (2012),RAttributes,Wolfram 语言函数,https://reference.wolfram.com/language/RLink/ref/RAttributes.html.
CMS
Wolfram 语言. 2012. "RAttributes." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/RLink/ref/RAttributes.html.
APA
Wolfram 语言. (2012). RAttributes. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/RLink/ref/RAttributes.html 年
BibTeX
@misc{reference.wolfram_2026_rattributes, author="Wolfram Research", title="{RAttributes}", year="2012", howpublished="\url{https://reference.wolfram.com/language/RLink/ref/RAttributes.html}", note=[Accessed: 18-July-2026]}
BibLaTeX
@online{reference.wolfram_2026_rattributes, organization={Wolfram Research}, title={RAttributes}, year={2012}, url={https://reference.wolfram.com/language/RLink/ref/RAttributes.html}, note=[Accessed: 18-July-2026]}