Displaying 3 results from an estimated 3 matches for "desubn".
Did you mean:
design
2016 Dec 12
2
why does parent.frame() cycle when called from inside capture.output()?
...I'm attaching this function in
case anyone is curious. Perhaps my attachment can shed more light on
the problem I'm having.
Apologies if this is not a bug - I wasn't sure which mailing list to
send this to, and I took a guess.
Thanks,
Frederick
-------------- next part --------------
desubN <- function(y,n=1) {
env=environment();
for(i in 1:n) {
y = do.call(substitute, list(substitute(y)), env=env)
env = do.call(parent.frame, list(), env=env)
}
deparse(y)
}
g2=function(t) {
for(i in 1:5) {
print(desubN(t,i))
print(capture.output(desubN(t,i)))
}
}
g1=func...
2016 Dec 12
2
why does parent.frame() cycle when called from inside capture.output()?
...I'm attaching this function in
case anyone is curious. Perhaps my attachment can shed more light on
the problem I'm having.
Apologies if this is not a bug - I wasn't sure which mailing list to
send this to, and I took a guess.
Thanks,
Frederick
-------------- next part --------------
desubN <- function(y,n=1) {
env=environment();
for(i in 1:n) {
y = do.call(substitute, list(substitute(y)), env=env)
env = do.call(parent.frame, list(), env=env)
}
deparse(y)
}
g2=function(t) {
for(i in 1:5) {
print(desubN(t,i))
print(capture.output(desubN(t,i)))
}
}
g1=func...
2016 Dec 12
0
[RE: why does parent.frame() cycle when called from inside capture.output()?]
...how we might fix or work
around it.
I notice some other people also seem to be diffident about posting on
R-devel; perhaps I should conclude that bugs like this are below the
radar for busy statisticians.
FWIW, after playing around a bit with mvbutils::mvb.parent.frame, I
now have a working "desubN" (see the attachment on my original
message, and this one). I don't really have a good understanding of
*why* it now works, and why the original version didn't work...
Thanks again Mark. Also, nice hacking.
Frederick
----- Forwarded message from Mark.Bravington at data61.csiro.au --...