Skip to content

error in "ca.jo"

11 messages · mamush bukana, Patrick Burns, Jeff Newmiller +4 more

#
There is a fundamental problem with your
code, and there is the problem that you
have (sort of) identified.

The fundamental problem is that you are
only going to get the results of the last
call to 'ca.jo' that is done -- assuming
it were to run.  You presumably want to
save some information from each of the
computations.

You can get the loops to run even when you
run into an error with some combinations
by using 'try' or 'tryCatch'.  There is an
example in Circle 8.3.13 of 'The R Inferno'.

http://www.burns-stat.com/documents/books/the-r-inferno/

If you have a question related to the actual
function as opposed to general problems with
R, then the r-sig-finance mailing list would
be appropriate (you need to subscribe before
posting).

I'm not sure if this is enough of a hint for
you or not.  If not, then trying to formulate
a more explicit question might help.  (There
are some suggestions in Circle 9 of 'The R
Inferno'.)

Pat
On 23/12/2013 17:07, mamush bukana wrote:

  
    
#
Once you start describing your code in language that indicates you have read some of the recommended materials, we can make some progress. For example, you are still posting in HTML format so your code is getting mangled (see Posting Guide). You don't seem to understand what tryCatch does (see ?tryCatch; hint... it does not alter the result returned by ca.jo, nor does it guarantee that any result will be returned). For that matter, you don't seem to understand how to give valid inputs to ca.jo, but then you don't seem to understand how to provide a reproducible example either (see for example http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example).

In short, if you ask us why one divided by zero doesn't give 3, we have to wonder if you don't belong in some other educational forum, because this is not a mathematics theory support group... it is about R. Please read or otherwise absorb the recommended background materials mentioned here and then ask clear questions here about R, or find some one-on-one help offline.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
mamush bukana <mamushbukana at gmail.com> wrote:
#
On Tue, Dec 24, 2013 at 3:36 PM, mamush bukana <mamushbukana at gmail.com> wrote:
This isn't just R-help.  You've also cross-posted (which many feel is
rude) to R-SIG-Finance, even though this is off-topic for
R-SIG-Finance.  Your problem is with R's control-flow and
error-handling, not anything finance-related.  Also, these being
"help" forums and you being a laymen does not mean you can ignore the
guidelines.

Rather than (again) not following the suggestions in the posting guide
("If you feel insulted by some response to a post of yours, don't make
any hasty response in return - you're more likely than not to regret
it."), you would be wise to follow Jeff's advice:
1) Stop posting in HTML, so people can copy/paste your code.
2) Provide a small, self-contained reproducible example.
3) Carefully read ?try and ?tryCatch; use rseek.org to search for examples.
4) Skip 1-3 and find some one-on-one help in person.

It would also be wise to follow *both* of Pat's recommendations (you
ignored his suggestion to save some information from the ca.jo
calculations).

In short, please follow the posing guide, rather than expect people to
voluntarily help you on your terms.
#
I am sorry you have chosen to interpret my response as unfriendly. I do not expect you or anyone posting here to be an expert before posting. However, the context here is that you have to read our responses anyway, so both Pat and I have recommended higher-quality reading material than we can write off the cuff. If you do read the recommended materials, you will be able to communicate in this forum effectively. If you do not, we will be guessing at problems we cannot know clearly about unless you tell us about them. You also need to read the Posting Guide to know what is on topic here, and what is not. When you start generating a lot of inputs to a function and getting errors then you may need to learn more about the theory behind that function... and this is not really the right place for that. So, please read the recommended materials and think about them before posting.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
mamush bukana <mamushbukana at gmail.com> wrote:
#
On 25/12/13 06:23, Jeff Newmiller wrote:
<SNIP>
<SNIP>

Fortune!

     cheers,

     Rolf Turner
#
Out of context, I would agree with you. However, I stand behind it as regards the original question... the OP should have had no trouble recognizing what the error message meant and what to do about it if they were even somewhat familiar with the applicable theory (differential equations), and this is not the appropriate forum for that conversation.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
Andrew Robinson <A.Robinson at ms.unimelb.edu.au> wrote:
#
Please, everyone civility is a positive virtue
J

Sent from my iPhone
Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}