Skip to content
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

Using ⟂ to indicate independence #72

Open
behrman opened this issue May 22, 2023 · 2 comments
Open

Using ⟂ to indicate independence #72

behrman opened this issue May 22, 2023 · 2 comments

Comments

@behrman
Copy link

behrman commented May 22, 2023

@jtextor For consistency with the dagitty web interface and the most commonly used mathematical notation, and for better readability, I recommend that the dagitty R package use the ⟂ symbol instead of the current _||_ to indicate independence. R supports Unicode, as have all major operating systems for many years.

Unicode actually has at least three related symbols:

  • A ⊥ B : up tack (U+22A5)
  • A ⟂ B : perpendicular (U+27C2)
  • A ⟘ B : large up tack (U+27D8)

I'd recommend using the perpendicular symbol. It's the symbol used by \perp in LaTex and by the Python package with the closest functionality to dagitty.

I believe the required change would be:

r <- paste0( paste(nn[seq_along(x$X)],collapse=", "), " _||_ ",

" _||_ " -> " \U27C2 "

@jtextor
Copy link
Owner

jtextor commented May 22, 2023

I'd rather not make this change. Use of non-ASCII characters in R packages is still discouraged, and I have gotten complaints from CRAN maintainers not too long ago for attempting to use them. See https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Encoding-issues

@behrman
Copy link
Author

behrman commented May 22, 2023

@jtextor I completely agree that you want to have the dagitty R package work for those with older versions of R. The dagitty package DESCRIPTION file currently specifies R (>= 3.0.0). According to the CRAN manual section you linked to, the Unicode escape \uxxxx is "a portable way to have arbitrary text in character strings (only) in your R code" for R (>= 2.10).

It may be useful to check with the CRAN maintainers to see if having the mathematical symbol \u27c2 in a character string in your R code would present a portability problem for those running R (>= 3.0.0). Rather than never adopting an advance, such as Unicode, the manual seems to suggest the approach of detecting older systems and making character substitutions when necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants