원클릭으로
assertr
R assertr package for assertion pipelines. Use for assertive programming with data frames.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
R assertr package for assertion pipelines. Use for assertive programming with data frames.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
R language data analysis and visualization skill. Use when user asks to (1) run R scripts or code, (2) install/update R packages, (3) perform data analysis with R, (4) create visualizations with ggplot2/plotly, (5) statistical analysis, (6) data manipulation with tidyverse/dplyr/data.table. Triggers on keywords like "R语言", "R脚本", "ggplot", "tidyverse", "数据分析", "可视化".
R DALEX package for model explanations. Use for explaining complex machine learning models.
R iml package for interpretable ML. Use for model-agnostic interpretability methods.
R lime package for local explanations. Use for explaining individual predictions with local interpretable models.
R packages for ML interpretability. Use for explaining and interpreting machine learning models.
R vip package for variable importance. Use for computing and visualizing variable importance scores.
| name | assertr |
| description | R assertr package for assertion pipelines. Use for assertive programming with data frames. |
Assertive programming for R analysis pipelines.
library(assertr)
library(dplyr)
df %>%
assert(within_bounds(0, 120), age) %>%
assert(not_na, name) %>%
assert(is_uniq, id)
# 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)
# Row-level assertions
df %>%
verify(age >= 0) %>%
verify(income > 0) %>%
verify(nrow(.) > 0)
# Statistical assertions
df %>%
insist(within_n_sds(3), age) %>%
insist(within_n_mads(3), income)
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))
# 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)
# 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
)
# Check column existence
df %>%
has_all_names("id", "name", "age")
# Check column types
df %>%
assert(is.numeric, age, income) %>%
assert(is.character, name)
# Custom success function
df %>%
assert(not_na, name,
success_fun = success_append,
error_fun = error_append)