No articles match
cpp11 internals6 months ago
Initial setup and dev workflow | Code formatting | Code organization | Naming conventions | Vector classes | Coercion functions | Protection | Protect list | Unwind Protect
FAQ6 months ago
1. What are the underlying types of cpp11 objects? | 2. How do I add elements to a list? | 3. Does cpp11 support default arguments? | 4. How do I create a new empty list? | 5. How do I retrieve (named) elements from a named vector/list? | 6. How can I tell whether a vector is named? | 7. How do I return a cpp11::writable::logicals object with only a FALSE value? | 8. How do I create a new empty environment? | 9. How do I assign and retrieve values in an environment? What happens if I try to get a value that doesn't exist? | 10. How can I create a cpp11:raws from a std::string? | 11. How can I create a std::string from a cpp11::writable::string? | 12. What are the types for C++ iterators? | 13. My code has using namespace std, why do I still have to include std:: in the signatures of [[cpp11::register]] functions? | 14. How do I modify a vector in place? | 15. Should I call cpp11::unwind_protect() manually? | Destructors | Nested unwind_protect() | 16. Ok but I really want to call cpp11::unwind_protect() manually
Get started with cpp116 months ago
Introduction | Outline | Prerequisites | Getting started with C++ | No inputs, scalar output | Scalar input, scalar output | Vector input, scalar output | Vector input, vector output | Using cpp_source | Exercises | Other classes | Lists and data frames | Functions | Attributes | Missing values | Scalars | Integers | Doubles | Strings | Boolean | Vectors | Standard Template Library | Using iterators | Algorithms | Data structures | Vectors | Sets | Case studies | Gibbs sampler | R vectorisation versus C++ vectorisation | Using cpp11 in a package | Learning more
Motivations for cpp116 months ago
Motivations | Copy-on-write semantics | Improve safety | C safety | C++ safety | Altrep support | Altrep benchmarks | UTF-8 everywhere | C++11 features | Simpler implementation | Compilation speed | Header only | Vendoring | Protection | Growing vectors | Conclusion
S3 vectors9 months ago
Basics | Percent class | format() method | Casting and coercion | Double dispatch | Percent class | Decimal class | Cached sum class | Record-style objects | Rational class | Decimal2 class | Equality and comparison | Polynomial class | Make an atomic polynomial vector | Implementing equality and comparison | Arithmetic | Cached sum class | Meter class | Implementing a vctrs S3 class in a package | Getting started | Low-level and user-friendly constructors | Other helpers | Testing | Existing classes
Converting from Rcpp2 years ago
Getting started | Cheatsheet | Vectors | Other objects | Functions | R functions | Unsupported Rcpp features | RNGs | Common issues when converting | STL includes | Strict headers | R API includes | Type aliases | Logical vector construction
Prototypes and sizes3 years ago
Prototype | Base prototypes | Coercing to common type | Casting to specified type | Size | Slicing | Common sizes: recycling rules | Appendix: recycling in base R
Examples and Recipes3 years ago
The current local time | The current time somewhere else | Set a meeting across time zones | High level API | Force a specific time zone | Finding the next Monday (or Thursday) | Generate sequences of dates and date-times | Grouping by months or quarters | Flooring by days | Day of the year | Computing an age in years | Computing number of weeks since the start of the year | Compute the number of months between two dates | Computing the ISO year or week | Computing the Epidemiological year or week | Converting a time zone abbreviation into a time zone name | When is the next daylight saving time event?
Frequently Asked Questions3 years ago
Why can't I do day arithmetic on a year-month-day? | Why can't I add time to a zoned-time? | Where did my POSIXct subseconds go? | What is the time zone of Date? | What does clock do with leap seconds? | Why doesn't this work with data.table?
Introduction to ivs4 years ago
Introduction | Structure | Right-open intervals | Empty intervals | Finding overlaps | Precedes / Follows | Allen's Interval Algebra | Between-ness | Counting overlaps | Grouping by overlaps | With .by | Minimal ivs | Splitting on endpoints | Set operations | Pairwise set operations | Missing intervals
Stack Overflow Examples4 years ago
iv_groups() | iv_identify_group() | iv_identify_splits() | iv_count_between() | iv_count_overlaps() | iv_count_includes() | iv_set_complement() | iv_locate_overlaps() | iv_overlaps()
Type and size stability4 years ago
Definitions | Examples | c() and vctrs::vec_c() | Atomic vectors | Incompatible vectors and non-vectors | Factors | Date-times | Dates and date-times | Missing values | Data frames | Matrices and arrays | Implementation | ifelse()
Changing periodicity4 years ago
Introducing as_period() | Datasets required | Daily to monthly | Generic periods | Details and the start_date argument | The side argument | Grouped datasets
Use with dplyr4 years ago
Package motivation | Index manipulation | Multiple series
Rolling calculations in tibbletime4 years ago
Introducing rollify() | Datasets required | A rolling average | Purrr functional syntax | Optional arguments | Returning more than 1 value per call | Custom missing values | Rolling regressions
Printing vectors nicely in tibbles4 years ago
Prerequisites | Using in a tibble | Fixing the data type | Custom rendering | Truncation | Adaptive rendering | Testing
Getting Started5 years ago
Building | Parsing | Parsing dates | Parsing date-times | date_time_parse() | date_time_parse_complete() | date_time_parse_abbrev() | date_time_parse_RFC_3339() | Grouping, rounding and shifting | Grouping | Rounding | Shifting | Arithmetic | Getting and setting
Getting started with slider6 years ago
slide() | slide_index() | slide_period()
Converting from tsibble6 years ago
slide() | tile() | stretch()
Row-wise iteration with slider6 years ago
Row-wise iteration | Varying parameter combinations | Sliding inside a mutate()
Hour Distances and Daylight Savings7 years ago
Spring Forward Gap | Fall Backwards Overlap | Conclusion
Time-based filtering9 years ago
Introducing filter_time() | Datasets required | Year filtering example | Month filtering example | Keywords | Grouped example | Finer periods | [ syntax | Using variables in the filter