Displaying 4 results from an estimated 4 matches for "ggproto".
Did you mean:
ggplot2
2024 Apr 12
1
Debugging functions defined (locally) inside another functions
...not work as g is not a defined function in the
> namespace of the package.
Moreover, `g` doesn't exist at all until f() is evaluated and reaches
this point. If `f` was a function, it would be possible to trace() it,
inserting a call to debug(g) after it's created.
> f <- ggplot2::ggproto(...)
>
> So debug(f) produces
> Error in debug(f) : argument must be a function
Can you show more information about the call that produces `f`? Where
does `g` come into play? Following ?ggplot2::ggproto, I can trigger the
browser if I reach into the environment of the publicly available...
2024 Apr 12
3
Debugging functions defined (locally) inside another functions
Hi all, I am trying to debug an error of a function g defined and used inside another function f of a package.
So I have
f <- function(whatever){
...
g <- function(whatever2){
...
}
...
}
If I wanted to debug some thing directly inside f I would do debug(f). But this does not go inside g code. On the other hand, debug(g) does not work as g is not a defined function in the
2024 Apr 12
1
Debugging functions defined (locally) inside another functions
...not work as g is not a defined function in the
> namespace of the package.
Moreover, `g` doesn't exist at all until f() is evaluated and reaches
this point. If `f` was a function, it would be possible to trace() it,
inserting a call to debug(g) after it's created.
> f <- ggplot2::ggproto(...)
>
> So debug(f) produces
> Error in debug(f) : argument must be a function
Can you show more information about the call that produces `f`? Where
does `g` come into play? Following ?ggplot2::ggproto, I can trigger the
browser if I reach into the environment of the publicly available
m...
2018 Mar 07
0
ggplot2: plot gruped/nested split violins
...lin plots for splits 1 and 2
within groups A and B for each count (which would be in the logscale, but
that is not important for this example). We have four groups for each
setting but there is a nested aspect to it.
Here is what I have tried:
-start-cut-and-paste-again---
GeomSplitViolin <- ggproto("GeomSplitViolin", GeomViolin,
draw_group = function(self, data, ..., draw_quantiles = NULL){
# By @YAK: https://stackoverflow.com/questions/35717353/split-violin-plot-with-ggplot2
data <- transform(data, xminv = x - violinwidth * (x - xmin),
xmaxv = x + violinwidth * (xmax...