在修改我为More efficient plot functions in R when millions of points are present? 所做的答案时,我必须解决类似的问题。这是一个适合您需要的版本:
my_dropdownMenu = function(...,
type = c("messages", "notifications", "tasks"),
badgeStatus = "primary", icon = NULL, .list = NULL)
{
message("Got here!")
# ...
# (COPY AND PASTE body(mydropdownMenu) HERE)
# (and then make your modifications)
}
# helper function, see
# https://stat.ethz.ch/pipermail/r-help/2008-August/171217.html
rebindPackageVar = function(pkg, name, new) {
# assignInNamespace() no longer works here, thanks nannies
ns=asNamespace(pkg)
unlockBinding(name,ns)
assign(name,new,envir=ns,inherits=F)
assign(name,new,envir=globalenv())
lockBinding(name,ns)
}
# make sure we can call non-exported functions (like validateStatus())
environment(my_dropdownMenu) = asNamespace("shinydashboard")
# now rebind the dropdownMenu function
rebindPackageVar("shinydashboard", "dropdownMenu", my_dropdownMenu);
示例输出。 “到了!”显示我们修改后的版本正在执行,剩下的就是函数的正常输出:
> dropdownMenu()
Got here!
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope"></i>
...