I don't know how to show this problem (to me it is a problem) because the problem occurred in an interactive session, and the form of the problem depends on the IDE being used. I tried R default console, RStudio, and Visual Studio Code, and the problems are different.
Simply put, because "\n" is not printed when the method ends, something unexpected can occur. For example, in R default console,
the is the last line:
RMSEA = 0.023, CFI = NaN, TLI = NaN>
The cursor is right after >.
In Visual Studio Code, this is the last line:
> SEA = 0.023, CFI = NaN, TLI = NaN
The cursor will overlap with S in SEA.
In RStudio, this is the last line:
RMSEA = 0.023, CFI = NaN, TLI = NaN>
>
The problem is less severe because the only issue is the > at the end of the line.
When users use the print method, it is natural to expect that this method will "cat" a "\n" when it ends. This is how the print method usually behaves.
How about adding cat("\n") after line 91, before the print method ends?
I don't know how to show this problem (to me it is a problem) because the problem occurred in an interactive session, and the form of the problem depends on the IDE being used. I tried R default console, RStudio, and Visual Studio Code, and the problems are different.
This code and reproduce the problem:
Simply put, because "\n" is not printed when the method ends, something unexpected can occur. For example, in R default console, the is the last line:
The cursor is right after
>
.In Visual Studio Code, this is the last line:
The cursor will overlap with
S
inSEA
.In RStudio, this is the last line:
The problem is less severe because the only issue is the
>
at the end of the line.When users use the
print
method, it is natural to expect that this method will "cat" a "\n" when it ends. This is how theprint
method usually behaves.How about adding
cat("\n")
after line 91, before theprint
method ends?https://github.com/philchalmers/mirt/blob/6ef8918af53996f3ab70ca614bba8a3bfc0b67e6/R/SingleGroup-methods.R#L86-L92