Re: [R] keep information on the number of warnings

2014-08-06 Thread Luis Borda de Agua
Thank you very much, David, Luís On 04 Aug 2014, at 17:24, Luis Borda de Agua wrote: > Dear David > > Thank you very much for your reply. I’ve only seen it now. > I tried length(warnings) and I got a strange result. > > When I used > > lw <- length(warnings) > print(lw) > > I obtained lw=36

[R] keep information on the number of warnings

2014-08-05 Thread Luis Borda de Agua
Dear David, Once again, thank you very much for your email. I believe I understand why I got a different number of "warnings”. It seems that when you type "length(warnings)" you keep the information on the run before the last. I come up with a simple example called "testing" (you will need to

Re: [R] keep information on the number of warnings

2014-08-04 Thread William Dunlap
Look at withCallngHandlers for another way to capture warnings. It will let you attach warnings from an iteration of your function to the output of the function so you can later track down the root cause of the warning. E.g., the attached captureWarningsAndMessagesWithContext attaches warnings, m

Re: [R] keep information on the number of warnings

2014-08-04 Thread David Winsemius
On Aug 4, 2014, at 9:24 AM, Luis Borda de Agua wrote: > Dear David > > Thank you very much for your reply. I‚ve only seen it now. > I tried length(warnings) and I got a strange result. > > When I used > > lw <- length(warnings) > print(lw) > > I obtained lw=36 > > however, the number of w

[R] keep information on the number of warnings

2014-08-04 Thread Luis Borda de Agua
Dear David Thank you very much for your reply. I’ve only seen it now. I tried length(warnings) and I got a strange result. When I used lw <- length(warnings) print(lw) I obtained lw=36 however, the number of warnings was 38 according to message to screen: "There were 38 warnings (use warni

Re: [R] keep information on the number of warnings

2014-07-31 Thread David Winsemius
On Jul 31, 2014, at 9:26 AM, Luis Borda de Agua wrote: > I’m using R 3.1.0 in OS X 10.9.4 (Mavericks) > > I’m running a function Y that calls a function X which occasionally generates > a warning. > Say that I call the function X 1000 times, and out of these 1000 times I get > the following m

[R] keep information on the number of warnings

2014-07-31 Thread Luis Borda de Agua
I’m using R 3.1.0 in OS X 10.9.4 (Mavericks) I’m running a function Y that calls a function X which occasionally generates a warning. Say that I call the function X 1000 times, and out of these 1000 times I get the following message: "There were 36 warnings (use warnings() to see them)" How c