-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NULL when printing egor object #80
Comments
As far as I can tell |
Printing 'egor' objects now simply calls pillar:::print.tbl_df() for each of the elements of the objects. In order to skip the "header" which we print in our own way (data level plus the "active" adjective if applicable) it is necessary to add the method for tbl_sum() as printing of tibbles cannot be controled with arguments nor options. Package 'pillar' is now imported. Upgrade RoxygenNote in DESCRIPTION. References #80.
Thank you @mbojan! Printing works well now. |
@mbojan the ANSI code style string for coloring "active" in green in Line 337 in e5980a5
When rendering Rmarkdown to pdf for some reason those strings create an invalid character that Latex can't render to pdf regardless of the latex engine (pdflatex, xelatex or lualatex). The result is the Rmd can't be rendered to pdf due to invalid character error ( Can I remove that part ( Reproducible: ---
title: "Test"
output:
pdf_document:
latex_engine: xelatex
date: '2022-12-05'
editor_options:
chunk_output_type: console
---
```{r}
library(tidyverse)
library(egor)
# Create egor
e1 <- egor(alters = alters32,
egos = egos32,
aaties = aaties32,
ID.vars = list(
ego = ".EGOID",
alter = ".ALTID",
source = ".SRCID",
target = ".TGTID"))
# Print egor
e1
# Note no green coloring in tidygraph print output
library(tidygraph)
as_igraph(e1) |>
pluck(1) |>
as_tbl_graph()
|
I'll be happy to get rid of it all together, but it's a baby of @tilltnet
;) imho we need to either do some sort of output-specifc-printing (i don't
remember how pillar does it) or get rid of it.
|
@tilltnet what do you think? Do you see any other solution (other than getting rid of it) to avoid that error when rendering to pdf? Also note that the \033 character is disregarded and green coloring is not rendered in htlm, see for example the egor vignette: https://cran.r-project.org/web/packages/egor/vignettes/using_egor.html#base-r |
If we want to keep the coloring, the cli package could be used for colored print output. crayon is deprecated but works. @mbojan Yes, please go ahead and remove the coloring or feel free to look into how to do it with |
Removed (temporarily?) to allow pdf rendering from Rmd. Code coloring string causes "invalid character" error when compiling latex doc to pdf. See #80
When printing an egor object no data head is displayed, just NULL. This happens even though the egor object can be correctly analyzed. It seems to happen for any egor object, including those created in the main egor vignette.
Reproducible:
Print output in my console:
Session info:
The text was updated successfully, but these errors were encountered: