Thanks a lot both Duncan and Ivan,
I will keep that example in mind, Duncan, great!
Best regards,
Iago
De: Duncan Murdoch
Enviat el: divendres, 12 d�abril de 2024 15:36
Per a: Iago Gin� V�zquez ; r-help@r-project.org
Tema: Re: [R] Debugging functions defined
On 12/04/2024 8:15 a.m., Iago Giné Vázquez wrote:
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
В Fri, 12 Apr 2024 12:53:02 +
Iago Giné Vázquez пишет:
> How should I call trace() if f was a function?
Let the tracer be quote(debug(g)) and use as.list(body(f)) to determine
where it should be injected:
f <- function() {
message('exists("g") so far is ', exists('g'))
g <- function() {
a call to debug(g) after it's created.
How should I call trace() if f was a function?
Best regards,
Iago
De: Ivan Krylov
Enviat el: divendres, 12 d��abril de 2024 14:38
Per a: Iago Gin�� V��zquez
A/c: r-help@r-project.org
Tema: Re: [R] Debugging functions defined
В Fri, 12 Apr 2024 12:15:07 +
Iago Giné Vázquez пишет:
> 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,
>
14:15
Per a: r-help@r-project.org
Tema: [R] 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(
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
knitr::purl -- thats a great tip! As soon as got hold of a reqular .R
script, I spotted the reason why my Fmd file wouldn't knit in a matter
of seconds. Thank you Jeff. Thanks also to all the other suggestions.
On Fri, 19-Apr-2019 at 02:44PM -0700, Jeff Newmiller wrote:
|> I just run each
You can set the error handler to save the current state of R in a file,
"last.dump.rda" in the current working directory, when an error occurs with
options(error=expression(dump.frames(to.file=TRUE,
include.GlobalEnv=TRUE)))
In another R session you can look at what it saved with
Chunks are not isolated... they are executed in sequence in the same
environment, starting with a fresh environment unrelated to whatever is present
when you invoke render().
On April 19, 2019 3:00:33 PM PDT, Patrick Connolly
wrote:
>There are options to set echo and messages but AFAIK, the
There are options to set echo and messages but AFAIK, the text appears
in the resultant file, but if the script fails, there's no file to inspect.
On 20/04/19 9:50 AM, Bert Gunter wrote:
> This might be offbase, but do you need to set options to cache the
> results in the original code chunks
This might be offbase, but do you need to set options to cache the results
in the original code chunks to reuse in later chunks? (I haven't worked
with knitr lately, so this may be nonsense).
Cheers,
Bert
On Fri, Apr 19, 2019 at 2:03 PM Patrick Connolly
wrote:
>
> On 19/04/19 12:13 AM, Thierry
I just run each chunk in sequence starting from an fresh restart of R by
copying code to the R console. However you can use knitr::purl to extract all
of the code into a regular R script to do whatever debugging you are most
familiar with.
On April 19, 2019 2:03:00 PM PDT, Patrick Connolly
On 19/04/19 12:13 AM, Thierry Onkelinx wrote:
> Dear Patrick,
>
> This is not easy to debug without a reprex
>
> I would check the content of zzz and wide.i in the loop
>
> str(wide.i)
> zzz <- rbind(zzz, wide.i)
> str(zzz)
>
That's just what I'm trying to achieve but the debugging doesn't work
Dear Patrick,
This is not easy to debug without a reprex
I would check the content of zzz and wide.i in the loop
str(wide.i)
zzz <- rbind(zzz, wide.i)
str(zzz)
Note that the Rmd always runs in a clean environment. This might explain
the difference
Best regards,
ir. Thierry Onkelinx
I have a function that works in ESS, but it fails if I include it in
an .Rmd file that I tried to knit using Rstudio. I found advice at:
https://www.rstudio.com/products/rstudio/release-notes/debugging-with-rstudio/
It seems to be not referring to markdown files. Somewhere else
suggested
I just wanted to put this out there. It's just some of my observations
about things that happen with R, or happened in this particular
investigation. There were definitely some lessons for me in this, and
maybe that will be true of someone else. The main thing I picked up is
that it is good
This is a rather detailed analysis, thanks, but I think it should be
send to the maintainer of the RFGLS package (CCing).
Best,
Uwe Ligges
On 25.12.2014 10:04, Mike Miller wrote:
I just wanted to put this out there. It's just some of my observations
about things that happen with R, or
Thanks, but I was already in touch with Rob Kirkpatrick about it. We all
work together at U Minnesota, or did until Rob went to VCU.
Mike
On Thu, 25 Dec 2014, Uwe Ligges wrote:
This is a rather detailed analysis, thanks, but I think it should be
send to the maintainer of the RFGLS package
On Dec 25, 2014, at 1:04 AM, Mike Miller mbmille...@gmail.com wrote:
I just wanted to put this out there. It's just some of my observations about
things that happen with R, or happened in this particular investigation.
There were definitely some lessons for me in this, and maybe that
On Thu, 25 Dec 2014, David Winsemius wrote:
On Dec 25, 2014, at 1:04 AM, Mike Miller mbmille...@gmail.com wrote:
I just wanted to put this out there. It's just some of my observations
about things that happen with R, or happened in this particular
investigation. There were definitely some
On Fri, 22-Feb-2013 at 02:23PM -0500, jim holtman wrote:
| Run with:
|
| options(error=utils::recover)
|
| Then at the point of the error you will be able to examine sigma2$id
| which is probably not a numeric. Any time you get an error like this,
| if you have been using the above statement
On 13-02-28 4:20 AM, Patrick Connolly wrote:
On Fri, 22-Feb-2013 at 02:23PM -0500, jim holtman wrote:
| Run with:
|
| options(error=utils::recover)
|
| Then at the point of the error you will be able to examine sigma2$id
| which is probably not a numeric. Any time you get an error like this,
|
?findLineNum in conjunction with ?setBreakpoint and ?traceback or
options(error=recover) seems like a good strategy within R. Not sure
what you can get on the IDE end.
Michael
On Tue, Feb 21, 2012 at 2:38 AM, jpm miao miao...@gmail.com wrote:
Hello,
I am using RStudio and have trouble
Both ESS (with ess-tracebug) and StatET (an R plug-in for Eclipse) has
debugger function.
Shige
On Tue, Feb 21, 2012 at 8:16 AM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
?findLineNum in conjunction with ?setBreakpoint and ?traceback or
options(error=recover) seems like a good
Hello,
I am using RStudio and have trouble finding out the problematic line in
the presence of a bug. Could I view the line NUMBER which contains a bug?
Is there any R editor able to do it?
Thanks,
Miao
[[alternative HTML version deleted]]
Dear all,
I am using browse() to debug my R applications. My problem is that I need a bit
more control of the debugging process.
For example 'I want R to stop at the 7th iteration and check. One can do think
that I can put the browse inside an if statement but this limits by lot the
On Sun, Feb 5, 2012 at 3:01 AM, Alaios ala...@yahoo.com wrote:
Dear all,
I am using browse() to debug my R applications. My problem is that I need a
bit more control of the debugging process.
For example 'I want R to stop at the 7th iteration and check. One can do
think that I can put the
Hi Alex,
some hints and advices on debugging can be found in the 'Writing R Extensions
Manual':
http://cran.r-project.org/doc/manuals/R-exts.html#Debugging-R-code
Depending on the IDE/editor you are using, there may be additional
debugging tools/options, but without further informations about
On 12-02-05 3:01 AM, Alaios wrote:
Dear all,
I am using browse() to debug my R applications. My problem is that I need a bit
more control of the debugging process.
For example 'I want R to stop at the 7th iteration and check. One can do think
that I can put the browse inside an if statement
On Sat, Dec 3, 2011 at 2:38 AM, Michael comtech@gmail.com wrote:
Hi all,
Could you please help me?
I am having the following weird problem when debugging R programs
using browser():
In my function, I've inserted a browser() in front of Step 1. My
function has 3 steps and at the end of
Hi all,
Could you please help me?
I am having the following weird problem when debugging R programs
using browser():
In my function, I've inserted a browser() in front of Step 1. My
function has 3 steps and at the end of each step, it will print out
the message Step i is done...
However, after
On 11-12-02 8:38 PM, Michael wrote:
Hi all,
Could you please help me?
I am having the following weird problem when debugging R programs
using browser():
In my function, I've inserted a browser() in front of Step 1. My
function has 3 steps and at the end of each step, it will print out
the
Rainer wrote:
* On Thu, Oct 20, 2011 at 12:22 AM, Norm Matloff
* matl...@cs.ucdavis.eduwrote:
*
*
* I've developed a new R debugging tool, debugR, available at
* http://heather.cs.ucdavis.edu/debugR.html
*
* This basically replaces my edtdbg, which I will no longer be
* supporting
) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
--
On Thu, Oct 20, 2011 at 12:22 AM, Norm Matloff matl...@cs.ucdavis.eduwrote:
I've developed a new R debugging tool, debugR, available at
http
On Thu, Oct 20, 2011 at 12:22 AM, Norm Matloff matl...@cs.ucdavis.eduwrote:
I've developed a new R debugging tool, debugR, available at
http://heather.cs.ucdavis.edu/debugR.html
This basically replaces my edtdbg, which I will no longer be supporting.
The new tool is now decoupled from one's
I've developed a new R debugging tool, debugR, available at
http://heather.cs.ucdavis.edu/debugR.html
This basically replaces my edtdbg, which I will no longer be supporting.
The new tool is now decoupled from one's text editor, and has a lot more
features than edtdbg did.
Try it! Feedback
On 11-08-24 10:20 AM, Eran Eidinger wrote:
Hi,
I am not sure if this is the right list to ask this question (though I did
not find a more appropriate one).
I've started using R a month ago, and small scripts work fine. However, when
I start writing more complex code, it gets messy.
1. Is there
See also the debug function, which allows you to walk through a
function line by line.
I also concur with Duncan's recommendation to try the R package
system. I'm an author of one of two contributed documents available
from CRAN - Documentation: Contributed - Creating R
Hi,
I am not sure if this is the right list to ask this question (though I did
not find a more appropriate one).
I've started using R a month ago, and small scripts work fine. However, when
I start writing more complex code, it gets messy.
1. Is there any way to debug normally, with breakpoints?
On Wed, Aug 24, 2011 at 4:20 PM, Eran Eidinger e...@taykey.com wrote:
Hi,
I am not sure if this is the right list to ask this question (though I did
not find a more appropriate one).
I've started using R a month ago, and small scripts work fine. However, when
I start writing more complex
Another great tool is debugonce()
wrap your function name in it and then execute your function call.
debugonce(my.function)
out-my.function(df)
And you'll be brought into the same interactive browser. (its Vi if im not
mistaken which can take a little getting used to.)
Justin
On Wed, Aug
Wow, thanks Justin and Liviu,
DebugOnce and browser. great!
Eran
On Wed, Aug 24, 2011 at 5:34 PM, Justin Haynes jto...@gmail.com wrote:
Another great tool is debugonce()
wrap your function name in it and then execute your function call.
debugonce(my.function)
out-my.function(df)
And
Also check out the 'debug' package
On Wed, Aug 24, 2011 at 10:59 AM, Eran Eidinger e...@taykey.com wrote:
Wow, thanks Justin and Liviu,
DebugOnce and browser. great!
Eran
On Wed, Aug 24, 2011 at 5:34 PM, Justin Haynes jto...@gmail.com wrote:
Another great tool is debugonce()
wrap your
Hello all,
I am trying to impute some missing data using the mice package. The data
set I am working with contains 125 variables (190 observations),
involving both categorical and continuous data. Some of these variables
are missing up to 30% of their data.
I am running into a peculiar problem
Dear list members,
I am running a rather long forach loop while using 16 cores on a cluster
simultaneously using the package doMC. After approximately 12000 calculations I
get the following error message:
Fehler in calcs.iter(i) :
task 5166 failed - Indizierung auÃerhalb der Grenzen
On Thu, Feb 24, 2011 at 6:06 PM, Yan Jiao y.j...@ucl.ac.uk wrote:
Dear R user
How to make the program stop at the spot where the error occurs? I mean
inside the iterations,.
Check
?browser
?debug
Rainer
Many thanks
yan
options(error=utils::recover)
On Thu, Feb 24, 2011 at 12:06 PM, Yan Jiao y.j...@ucl.ac.uk wrote:
Dear R user
How to make the program stop at the spot where the error occurs? I mean
inside the iterations,.
Many thanks
yan
On 15/11/2010 10:53 PM, Steve Lianoglou wrote:
Hi,
I'm using R-2.12 on a linux 64bit machine.
When I run a chunk of code inside a foreach() %do% { ...} or %dopar%
{...} (with doMC backend) I keep getting a segfault. Running the
*same* code within lapply(something, function(x) ... ) doesn't
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 11/16/2010 04:53 AM, Steve Lianoglou wrote:
Hi,
I'm using R-2.12 on a linux 64bit machine.
When I run a chunk of code inside a foreach() %do% { ...} or %dopar%
{...} (with doMC backend) I keep getting a segfault. Running the
*same* code
Hi,
I'm using R-2.12 on a linux 64bit machine.
When I run a chunk of code inside a foreach() %do% { ...} or %dopar%
{...} (with doMC backend) I keep getting a segfault. Running the
*same* code within lapply(something, function(x) ... ) doesn't result
in any segfaults. I'll paste the output
I'm attempting to learn how to use the debug function to find the values of
some variables. I've found a couple of documents describing the basics and
they show examples that the debugger returns
Browse[1]
but for some reason when I follow the examples I get
Browse[2]
What is the 2
On 07/10/2010 6:09 AM, Maas James Dr (MED) wrote:
I'm attempting to learn how to use the debug function to find the values of
some variables. I've found a couple of documents describing the basics and
they show examples that the debugger returns
Browse[1]
but for some reason when I follow
substitute() does not have an argument 'list'; it does have 'env'.
Replace this line:
list = list (member = as.name (member),
with
env = list (member = as.name (member),
-Peter Ehlers
On 2010-05-14 3:09, Gil Tomás wrote:
Dear list,
A while ago I found in the web a
Dear list,
A while ago I found in the web a function (sadly I can't credit the
author as I don't remember where I picked it up from) whose output is
a dataframe that lists for every object in the global environment its
class, mode, dim length (where applicable). It is meant to be an
upgrade to
I read through the Writing R Extensions and the Debugging in R website
(http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/), looking for
some hints about how to solve the issue of debugging problems encountered
during the R CMD check process, but nothing seems to be mentioned about
On 07/01/2010 2:48 PM, Jason Rupert wrote:
I read through the Writing R Extensions and the Debugging in R website (http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/), looking for some hints about how to solve the issue of debugging problems encountered during the R CMD check process,
Dear Jason Rupert,
I would need to dig into this and cannot answer yet.
But I am about to take over maintainership of the orphaned signal
package and already registered an R-forge project (currently I only
cleaned up some files without really fixing issues). Have you already
invested some
for any insights or feedback.
- Original Message
From: Duncan Murdoch murd...@stats.uwo.ca
To: Jason Rupert jasonkrup...@yahoo.com
Cc: R-help@r-project.org
Sent: Thu, January 7, 2010 2:02:25 PM
Subject: Re: [R] Debugging issues encountered during the R CMD check process
On 07
On 06.01.2010 02:15, Markus Weisner wrote:
I am trying to debug a package to submit it to CRAN and am getting a bunch
of error messages. Most of the errors are because of the Rd files which
were automatically populated by the package.skeleton function. I find the
section on documentation to
Hello
On 1/6/10, Markus Weisner public.mar...@mac.com wrote:
* checking whether package 'NFIRS' can be installed ... WARNING
Found the following significant warnings:
missing link(s): ~~fun~~ CLASSNAME-class
See '/Users/markus/Dropbox/NFIRS_S4/NFIRS.Rcheck/00install.out' for
I am trying to debug a package to submit it to CRAN and am getting a bunch
of error messages. Most of the errors are because of the Rd files which
were automatically populated by the package.skeleton function. I find the
section on documentation to be pretty confusion in the R Extensions manual.
I posted the full extent of this question to Nabble, but essentially I'm having
difficulty determining the route cause of the unexpected string constant
error in the zp2ssg2.R (which I'm trying to port over from Octave).
Here is my current Nabble posting:
, November 27, 2009 6:10:24 PM
Subject: [R] Debugging the unexpected string constant error in the zp2ssg2.R
I posted the full extent of this question to Nabble, but essentially I'm having
difficulty determining the route cause of the unexpected string constant
error in the zp2ssg2.R (which I'm
Hi all,
Does anyone know how to debug S4 methods? In my case I want to find an
error in the specc-function of the kernlab-package.
As this seems to be a S4-method the normal S3 debugging can't be
applied apparently (e.g. debug(s3function.someclass)).
So in my case
debug(specc:kernlab)
seems
On 01/10/2009 7:02 AM, sebastian mueller wrote:
Hi all,
Does anyone know how to debug S4 methods? In my case I want to find an
error in the specc-function of the kernlab-package.
As this seems to be a S4-method the normal S3 debugging can't be
applied apparently (e.g.
dear R wizards---I am not sure at what point I owe pennance for asking
so many questions. I am now wrangling debugging. I want to write a
function
assert = function( condition, ... ) {
if (!condition) {
cat(...); cat(\n);
browser();
}
stopifnot(condition);
}
assert( nrow(ds)==12,
Dear R Users,
I implemented a try() statement that looks like:
- function(index)
{
reduced_model - try(glm.fit(X4,n,family=poisson(link=log)))
full_model - try(glm.fit(X5,n,family=poisson(link=log)))
if (inherits(reduced_model,try-error) ||
inherits(full_model,try-error)) return(NA)
G'day Juliet,
On Tue, 19 Feb 2008 21:35:11 -0500
Juliet Hannah [EMAIL PROTECTED] wrote:
I implemented a try() statement that looks like:
- function(index)
{
reduced_model - try(glm.fit(X4,n,family=poisson(link=log)))
full_model - try(glm.fit(X5,n,family=poisson(link=log)))
On 16 Nov 2007, at 15:05, Gabor Grothendieck wrote:
Try this:
f - function() {
for(i in 1:1000) {
if (i == 50) browser()
print(i)
}
}
# enters debugger when i is 50.
# n/c/Q will step one statement/continue/Quit respectively
f()
Thanks. The problem is that I don't
On 16 Nov 2007, at 14:16, Duncan Murdoch wrote:
On 11/16/2007 6:58 AM, Yan Wong wrote:
Hi,
I can't seem to find a way to do this (i.e. interrupt a routine at
an arbitrary time during its run, then step into it using the
debugger).
If you prepare in advance by using
On 11/16/2007 6:58 AM, Yan Wong wrote:
Hi,
I have an R program which takes several days to run, and sometimes
hangs while running, presumably stuck in some sort of loop within a
package function. I don't know where in the program code it is
hanging: it is likely to be within a routine
On 11/16/2007 9:48 AM, Yan Wong wrote:
On 16 Nov 2007, at 14:16, Duncan Murdoch wrote:
On 11/16/2007 6:58 AM, Yan Wong wrote:
Hi,
I can't seem to find a way to do this (i.e. interrupt a routine at
an arbitrary time during its run, then step into it using the
debugger).
If you
Try this:
f - function() {
for(i in 1:1000) {
if (i == 50) browser()
print(i)
}
}
# enters debugger when i is 50.
# n/c/Q will step one statement/continue/Quit respectively
f()
On Nov 16, 2007 6:58 AM, Yan Wong [EMAIL PROTECTED] wrote:
Hi,
I have an R program which takes
74 matches
Mail list logo