0
在下面的R代码片段(取自一个调试器)中,%||%运算符在第8行中的含义是什么?%||%运算符在R中表示什么?
function (env = caller_env(), default = NULL)
{
out <- switch_type(env, environment = env, definition = ,
formula = attr(env, ".Environment"), primitive = base_env(),
closure = environment(env), list = switch_class(env,
frame = env$env))
out <- out %||% default
if (is_null(out)) {
type <- friendly_type(type_of(env))
abort(paste0("Can't extract an environment from ", type))
}
else {
out
}
}
感谢您的帮助!
非常感谢!我完全丧失了在哪里看! – Babu
@Babu您可以找到像R'?“%||%”'中所有引号一样的操作符的帮助页面,以确保它可以被解析。 – MrFlick