Comments (7)
Sounds very promising -- thanks for that. Am in the middle of something at work and making dinner with kiddo 1 but will get back to this later.
Dirk
from rcpp-gallery.
It taste like C. Don't we want it more C++-ish? Part of our mantra was that "you can leave C behind". I feel we should keep that story.
from rcpp-gallery.
I thought about it a little harder, and it seems that all we really need (?) is the TYPEOF
macro from the R API as well as the internal RTYPEs. I cleaned it up and wrote a cleaner, more C++ solution (wrap to List initially, use list iterator, but still switch and wrap depending on the result of TYPEOF
)
Thanks for the comments -- take a look and let me know!
from rcpp-gallery.
I made some more mods (added a check for factors; make sure it gives sensible output when we have character vecs / factors in the list)
I'm not quite sure what you mean re: the default case, can you expand a bit?
from rcpp-gallery.
Sorry, not "the" default case. Meant to say that we need a fallback "default" case in the switch statement in order to catch errors caused by users submitting a char, or complex, or raw, or environment, or ... SEXP can be anything beyond int, double or another list.
from rcpp-gallery.
Gotcha. I added a default case that just throws a simple exception with stop
if a non-REALSXP or non-INTSXP is encountered. I also added a bit more exposition, re: what's going on. Thanks!
from rcpp-gallery.
This is done now, parallel comment threads and all.
from rcpp-gallery.
Related Issues (20)
- Proposed new entry: Customized printer for exposed C++ classes HOT 1
- Article on RcppArrayFire? HOT 4
- Add Gallery Post on Rcpp equivalent of stop(..., call.=FALSE) HOT 2
- Doxygen documentation in R package HOT 2
- remove outdated sparse matrix examples HOT 13
- Half of an article missing HOT 5
- Add examples for DateVector and DateTimeVector to Rcpp Gallery HOT 1
- Add example to subset a vector using an index range
- Update R package requirements in "Local Development Configuration" wiki HOT 9
- gist for example with update of 2013-07-13-dmvnorm_arma.Rmd HOT 6
- Add example of data.table object creation
- A pull request for a new entry? HOT 10
- Update MathJax to v3
- trivial typo HOT 2
- Getting different results for Sample HOT 2
- Updating the `STL random_shuffle for permutations` article HOT 7
- Bug in Gerber Statistic Code HOT 3
- CSS for bullet lists HOT 4
- Rcpp::StringVector HOT 2
- Updating Armadillo Subset HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcpp-gallery.