Re: [R] cat in a subroutine

2022-10-13 Thread Steven T. Yen
Hello, Oh Lord, yes, I had a function called "cat", with argument "j". That was very dumb. Renaming function cat resolved the problem. I had lived with this problem too long---avoiding printing with cat altogether in this program. Thanks to all-Bill, Iva, Jim, Erin, Andrew for help! On 10/

Re: [R] cat in a subroutine

2022-10-13 Thread Bill Dunlap
Do you have another function called "cat" in scope? (with an argument called "j")? Before calling cat("...") call print(cat) and print(find("cat")). -Bill On Thu, Oct 13, 2022 at 12:35 AM Steven T. Yen wrote: > I have had an issue with printing (with cat) in a subroutine for which I > do not

Re: [R] cat in a subroutine

2022-10-13 Thread Ivan Krylov
В Thu, 13 Oct 2022 15:49:57 +0800 "Steven T. Yen" пишет: > 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: > >

Re: [R] cat in a subroutine

2022-10-13 Thread Steven Yen
No. I just run the subroutine containing those line, with result going to destination go probit1.r.me.it and printed it. Steven from iPhone > On Oct 13, 2022, at 5:09 PM, Jim Lemon wrote: > > Have you assigned the valuie of goprobit1.r.me.kr to "fortytwo", or > indeed anything? > > Jim > >>

Re: [R] cat in a subroutine

2022-10-13 Thread Jim Lemon
Have you assigned the valuie of goprobit1.r.me.kr to "fortytwo", or indeed anything? Jim On Thu, Oct 13, 2022 at 8:02 PM Steven T. Yen wrote: > > Not really. > > fortytwo<-42 > cat("\nMarginal and Discrete Effects of Gen Ordered Logit / Probit > Probabilities", > "logisitic =",fortytwo,"\n"

Re: [R] cat in a subroutine

2022-10-13 Thread Steven T. Yen
Not really. fortytwo<-42 cat("\nMarginal and Discrete Effects of Gen Ordered Logit / Probit Probabilities",     "logisitic =",fortytwo,"\n") > goprobit1.r.me.kr<-me.gologit.r(goprobit1,embellished=TRUE, + resampling=TRUE,ndraws=5); goprobit1.r.me.kr Error in ca

Re: [R] cat in a subroutine

2022-10-13 Thread Jim Lemon
Hi Steven & Erin, This works: fortytwo<-42 cat("\nMarginal and Discrete Effects of Gen Ordered Logit / Probit Probabilities","logisitic =",fortytwo,"\n") j<-grep(".one\\b",c(".one\\a",".one\\b")) Marginal and Discrete Effects of Gen Ordered Logit / Probit Probabilities logisitic = 42 If I don't

Re: [R] cat in a subroutine

2022-10-13 Thread Steven Yen
t<-abs(me)/se; p<-2*(1-pt(t,nrow(x))) sig<-my.sig.levels(p) out<-data.frame(round(cbind(me,se,t,p),digits)); out<-cbind(out,sig) rownames(out)<-names(me) colnames(out)<-c("est","se","t","p","sig") cat("\nMarginal and Discrete Effects of Gen Ordered Logit / Probit Probabilities", "\n\nlogistic

Re: [R] cat in a subroutine

2022-10-13 Thread Erin Hodgess
Steven, would you mind putting that section of code in again, with the cat statement, please? I have an idea... Erin Hodgess, PhD mailto: erinm.hodg...@gmail.com On Thu, Oct 13, 2022 at 2:13 AM Jim Lemon wrote: > Hi Steven, > I think Erin is right, unless there is a variable named "logistic" >

Re: [R] cat in a subroutine

2022-10-13 Thread Steven Yen
Yes, these lines are part of a subroutine calling yet more procedures. What frustrated me was, I am not doing anything different from other routines. My cat command in the recent code does not do anything other than printing a line of plain text. I am clueless. Steven from iPhone > On Oct 13,

Re: [R] cat in a subroutine

2022-10-13 Thread Jim Lemon
Hi Steven, I think Erin is right, unless there is a variable named "logistic" visible within the function, "cat" will think it is either an argument or an R object. If you have the "psych" package loaded, it may see it as a closure. There is also a "Logistic" in the stats package, but that shouldn'

Re: [R] cat in a subroutine

2022-10-13 Thread Steven T. Yen
Thanks Erin. 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 Logi

Re: [R] cat in a subroutine

2022-10-13 Thread Erin Hodgess
All right. Are these lines of code part of a larger function, please? Is that function possibly calling a loop, please? Thanks, Erin On Thu, Oct 13, 2022 at 1:49 AM Steven T. Yen wrote: > Thanks Erin. > > No. Removing the second line (so that cat simply prints something else), > > cat("\nMarg

Re: [R] cat in a subroutine

2022-10-13 Thread Erin Hodgess
Hi Steven: Do you have a variable called logistic, please? I think that might be the culprit. Thanks, Erin On Thu, Oct 13, 2022 at 1:35 AM Steven T. Yen wrote: > I have had an issue with printing (with cat) in a subroutine for which I > do not have a applicable example, but I am still hoping