No articles match
cpp11 internals2 months ago
Initial setup and dev workflow | Code formatting | Code organization | Naming conventions | Vector classes | Coercion functions | Protection | Protect list | Unwind Protect
FAQ2 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 cpp112 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 cpp112 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 vectors6 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?
Holidays and calendars3 years ago
Holidays | hol_observe() | hol_offset() | Custom holidays | Calendars | cal_events() | cal_match() | US federal calendar
Introduction to almanac3 years ago
Recurrence Rules | Event Set | Caching | Recurrence Conditions | Recurrence Sets
Adjusting and shifting dates3 years ago
Adjusting | Adjusted rschedules | Stepping | Steppers
Quarterly rules3 years ago
First day of the quarter | Altering the fiscal year start | N-th day of the quarter | N-th week day of the quarter | Combining with other rules
iCalendar specification3 years ago
Daily for 10 events | Daily until 1997-12-24 | Every other day, forever | Every 10 days, 5 events | Every day in January, for 3 years | Weekly for 10 events | Weekly until December 24, 1997 | Every other week - forever | Weekly on Tuesday and Thursday for five weeks | Every other week on Monday, Wednesday, and Friday until December 24, 1997, starting on Monday, September 1, 1997 | Every other week on Tuesday and Thursday, for 8 events | Monthly on the first Friday for 10 events | Monthly on the first Friday until December 24, 1997 | Every other month on the first and last Sunday of the month for 10 events | Monthly on the second-to-last Monday of the month for 6 months | Monthly on the third-to-the-last day of the month, forever | Monthly on the 2nd and 15th of the month for 10 events | Monthly on the first and last day of the month for 10 events | Every 18 months on the 10th thru 15th of the month for 10 events | Every Tuesday, every other month | Yearly in June and July for 10 events | Every other year on January, February, and March for 10 events | Every third year on the 1st, 100th, and 200th day for 10 events | Every 20th Monday of the year, forever | Monday of week number 20 (where the default start of the week is Monday), forever | Every Thursday in March, forever | Every Thursday, but only during June, July, and August, forever | Every Friday the 13th, forever | The first Saturday that follows the first Sunday of the month, forever | Every 4 years, the first Tuesday after a Monday in November, forever (U.S. Presidential Election day) | The third instance into the month of one of Tuesday, Wednesday, or Thursday, for the next 3 months | The second-to-last weekday of the month | An example where the days generated makes a difference because of week_start | An example where an invalid date (i.e., February 30) is ignored
Introduction to ivs3 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 Examples3 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 stability3 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 periodicity3 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 dplyr3 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 slider5 years ago
slide() | slide_index() | slide_period()
Converting from tsibble5 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 Savings6 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