You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My package has different print() and show() methods. When I enter an expression on the console, the results are displayed using show(), not print(). A case in point is running example code for package functions. I think we would want to see what's displayed on the console; however, evidently pkgdown renders example results using print() rather than show().
I noticed this snippet for the man page for emmeans::ref_grid() on my pkgdown site:
fiber.lm <- lm(strength ~ machine*diameter, data = fiber)
ref_grid(fiber.lm)
#> machine diameter prediction SE df
#> A 24.1 40.2 0.777 9
#> B 24.1 41.6 0.858 9
#> C 24.1 38.5 0.966 9
#>
The above results are what is shown using print(). However, if I enter the code on the console, I see:
> fiber.lm <- lm(strength ~ machine*diameter, data = fiber)
> ref_grid(fiber.lm)
'emmGrid' object with variables:
machine = A, B, C
diameter = 24.133
... which are the results of show().
I also note that the reprex package *does use show(). Here are results using reprex::reprex():
library(emmeans)
## Welcome to emmeans.## Caution: You lose important information if you filter this package's results.## See '? untidy'fiber.lm<- lm(strength~machine*diameter, data=fiber)
ref_grid(fiber.lm)
## 'emmGrid' object with variables:## machine = A, B, C## diameter = 24.133
ref_grid(fiber.lm) |> show()
## 'emmGrid' object with variables:## machine = A, B, C## diameter = 24.133
ref_grid(fiber.lm) |> print()
## machine diameter prediction SE df## A 24.1 40.2 0.777 9## B 24.1 41.6 0.858 9## C 24.1 38.5 0.966 9
Created on 2025-01-30 with reprex v2.1.1
What we see here is the default, plus explicit pipes to show() and print().
I believe that pkgdown should use show() when it renders example output.
Note
I reference my site above, but probably by the time you review this issue, it will be rendered differently, as I changed the print method to show so as to get what I want to see on the site. However, I still think this is a bug in pkgdown and will revert to my old code when you fix it.
The text was updated successfully, but these errors were encountered:
My package has different
print()
andshow()
methods. When I enter an expression on the console, the results are displayed usingshow()
, notprint()
. A case in point is running example code for package functions. I think we would want to see what's displayed on the console; however, evidently pkgdown renders example results usingprint()
rather thanshow()
.I noticed this snippet for the man page for
emmeans::ref_grid()
on my pkgdown site:The above results are what is shown using
print()
. However, if I enter the code on the console, I see:... which are the results of
show()
.I also note that the reprex package *does use
show()
. Here are results usingreprex::reprex()
:Created on 2025-01-30 with reprex v2.1.1
What we see here is the default, plus explicit pipes to
show()
andprint()
.I believe that pkgdown should use
show()
when it renders example output.Note
I reference my site above, but probably by the time you review this issue, it will be rendered differently, as I changed the
print
method toshow
so as to get what I want to see on the site. However, I still think this is a bug in pkgdown and will revert to my old code when you fix it.The text was updated successfully, but these errors were encountered: