بنقرة واحدة
r-language-api
R interfaces to other languages. Use for calling Python, Java, JavaScript, and other languages from R.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
R interfaces to other languages. Use for calling Python, Java, JavaScript, and other languages from R.
التثبيت باستخدام 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 | r-language-api |
| description | R interfaces to other languages. Use for calling Python, Java, JavaScript, and other languages from R. |
Call other programming languages from R.
library(reticulate)
# Use Python
py_run_string("x = 1 + 1")
py$x
# Import modules
np <- import("numpy")
pd <- import("pandas")
# Call Python functions
np$array(c(1, 2, 3))
pd$DataFrame(list(a = 1:3, b = 4:6))
library(rJava)
# Initialize JVM
.jinit()
# Create Java objects
str <- .jnew("java/lang/String", "Hello")
# Call methods
.jcall(str, "I", "length")
.jcall(str, "S", "toUpperCase")
library(V8)
# Create context
ctx <- v8()
# Run JavaScript
ctx$eval("var x = 1 + 1")
ctx$get("x")
# Call functions
ctx$eval("function add(a, b) { return a + b; }")
ctx$call("add", 1, 2)
library(Rcpp)
# Inline C++
cppFunction('
int add(int x, int y) {
return x + y;
}
')
add(1, 2)
# Source C++ file
sourceCpp("functions.cpp")
# R to Python
py$df <- r_to_py(mtcars)
# Python to R
r_df <- py_to_r(py$df)
# Automatic conversion
reticulate::py_config()
# 1. Check availability
reticulate::py_available()
rJava::.jcheck()
# 2. Handle errors
tryCatch({
py_run_string("import nonexistent")
}, error = function(e) {
message("Python error: ", e$message)
})
# 3. Clean up resources
# Java: .jgc()
# V8: ctx$reset()