Bug with the matrix class such that attributes cannot be set
还没有人认领这个 Issue。
评估
调研方向
Start by tracing matrix class handling for attr("dimnames") and compare it with the working cpp_names example. Reproduce the commented cpp_colnames case and verify that matrix attributes can be assigned while preserving the expected row and column names.
由索引模型根据 Issue 内容生成。
描述
Such as it's the case for names(), it would be extremely convenient to have rownames() and colnames() in cpp codes.
My idea (sorry that I don't enough C++) would be like:
// THIS WORKS
[[cpp11::register]]
doubles cpp_names(writable::doubles X) {
X.attr("names") = {"a","b"};
return X;
}
// THIS WON'T
// [[cpp11::register]]
// doubles_matrix<> cpp_colnames(writable::doubles_matrix<> X) {
// writable::list dimnames;
// dimnames.push_back(NULL);
// dimnames.push_back({"a","b"});
// X.attr("dimnames") = dimnames;
// return X;
// }
- 主要语言
- C++
- 星标
- 224
- 派生
- 52
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
r-lib/cpp11 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 48/100
-
难度 5/5 一周以上 新手友好度 20/100
-
难度 3/5 1-2 天 新手友好度 42/100
-
难度 3/5 1-2 天 新手友好度 45/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 65/100
duckdb/duckdb-wasm#2258 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
objectionary/eo-graphs#75 ·
-
Coarray integration tests carry no LABELS, so run_tests.py silently skips them under every backend 未关闭coarray
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
FISCO-BCOS/FISCO-BCOS#5642 ·