[R] cat in a subroutine

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Thu Oct 13 11:33:15 CEST 2022


В Thu, 13 Oct 2022 15:49:57 +0800
"Steven T. Yen" <styen using ntu.edu.tw> пишет:

> No. Removing the second line (so that cat simply prints something
> else),
> 
> cat("\nMarginal and Discrete Effects of Gen Ordered Logit / Probit 
> Probabilities")
> #    "\n\nlogistic =",logistic)
> 
> I get yet another nonsense:
> 
> Error in cat("\nMarginal and Discrete Effects of Gen Ordered Logit / 
> Probit Probabilities") :
>    argument "j" is missing, with no default

I don't see any problems with quoting or parentheses in the parts of
the code you're showing us, but they may be present elsewhere.

If you step the function in debugger (see ?debugonce and ?browser),
does it crash in the call to cat()?

If you take your function apart by applying as.list(body(fun)) (and
furthermore applying as.list() to any parts of the function), do you
see the call to cat() taking exactly the arguments you mean it to take?

-- 
Best regards,
Ivan



More information about the R-help mailing list