R assertr package for assertion pipelines. Use for assertive programming with data frames.
Scanned 6/4/2026
Install via CLI
openskills install LeoLin990405/r-analytics-skill---
name: assertr
description: R assertr package for assertion pipelines. Use for assertive programming with data frames.
---
# assertr
Assertive programming for R analysis pipelines.
## Basic Assertions
```r
library(assertr)
library(dplyr)
df %>%
assert(within_bounds(0, 120), age) %>%
assert(not_na, name) %>%
assert(is_uniq, id)
```
## Predicates
```r
# Built-in predicates
within_bounds(0, 100) # Value in range
in_set(c("A", "B", "C")) # Value in set
not_na # Not NA
is_uniq # Unique values
# Custom predicate
is_positive <- function(x) x > 0
df %>%
assert(is_positive, income)
```
## Verify
```r
# Row-level assertions
df %>%
verify(age >= 0) %>%
verify(income > 0) %>%
verify(nrow(.) > 0)
```
## Insist
```r
# Statistical assertions
df %>%
insist(within_n_sds(3), age) %>%
insist(within_n_mads(3), income)
```
## Chain Assertions
```r
df %>%
verify(nrow(.) > 0) %>%
assert(not_na, id, name) %>%
assert(within_bounds(0, 120), age) %>%
insist(within_n_sds(3), income) %>%
# Continue with analysis
group_by(category) %>%
summarize(mean_age = mean(age))
```
## Error Handling
```r
# Custom error function
df %>%
chain_start %>%
assert(not_na, name) %>%
assert(is_uniq, id) %>%
chain_end(error_fun = error_append)
# Just warn
df %>%
assert(not_na, name, error_fun = just_warn)
# Return logical
df %>%
assert(not_na, name, error_fun = error_logical)
```
## Assert Rows
```r
# Row-wise assertions
df %>%
assert_rows(
rowSums,
within_bounds(0, 100),
col1, col2, col3
)
# Custom row function
df %>%
assert_rows(
function(x) x$end - x$start,
function(x) x >= 0,
end, start
)
```
## Column Assertions
```r
# Check column existence
df %>%
has_all_names("id", "name", "age")
# Check column types
df %>%
assert(is.numeric, age, income) %>%
assert(is.character, name)
```
## Success/Failure Functions
```r
# Custom success function
df %>%
assert(not_na, name,
success_fun = success_append,
error_fun = error_append)
```
No comments yet. Be the first to comment!
This skill helps you track, analyze, and report on keyword ranking positions over time. It monitors both traditional SERP rankings and AI/GEO visibility to provide comprehensive search performance insights.
Find and analyze YouTube competitor channels using YouTube Data API v3. Discover competitors through keyword search, category matching, content similarity, and related channel discovery. Compare metrics, content strategies, and market positioning. Use when users want to (1) Find competitors for their YouTube channel, (2) Analyze competitor performance metrics, (3) Compare their channel against competitors, (4) Identify content gaps and opportunities, (5) Benchmark against similar creators, (6...
Get current weather and forecasts (no API key required).
Focused Signals scout for PostHog projects using revenue analytics. Watches the derived revenue product for upstream failures (Stripe sync stalls, capture regressions), config drift (missing subscription property, currency mix surprises, broken Stripe↔person joins, deferred-revenue gaps), and goal-miss escalations. Emits findings only when they clear the confidence bar; otherwise writes durable memory and closes out empty. Self-contained peer in the signals-scout-* fleet — no dependencies on ...
Focused Signals scout for finding observability gaps in PostHog itself — significant event volumes the team isn't tracking, custom events with no insight or dashboard coverage, insights pointing at events that have stopped firing, dashboards missing related context, critical events with no alerts. Watches the event-stream-vs-saved- inventory delta as the team's product evolves and emits findings recommending new insights, dashboard additions, or alerts when gaps clear the confidence bar. Self...