New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attributes ignored on non-writable
objects during explicit set or construction
#237
Comments
@jimhester 7312b66 actually broke my second example, which I believe is valid. #include "cpp11.hpp"
using namespace cpp11::literals;
[[cpp11::register]]
cpp11::data_frame test_right() {
cpp11::writable::doubles time({123456});
time.attr("class") = cpp11::strings({"POSIXct", "POSIXt"});
time.attr("tzone") = cpp11::strings({"UTC"});
return cpp11::writable::data_frame({
"time"_nm = time
});
}
|
In this case there is no need for the explicit cpp11::cpp_source(code = '#include <cpp11.hpp>
using namespace cpp11::literals;
[[cpp11::register]]
cpp11::data_frame test_right() {
cpp11::writable::doubles time({123456});
time.attr("class") = {"POSIXct", "POSIXt"};
time.attr("tzone") = {"UTC"};
return cpp11::writable::data_frame({
"time"_nm = time
});
}
')
test_right()
#> time
#> 1 1970-01-02 10:17:36 Created on 2021-10-29 by the reprex package (v2.0.1) |
I see. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issues:
cpp11::data_frame
constructor produces a list instead of a data frameThe text was updated successfully, but these errors were encountered: