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

≥ in rownames #38

Open
rxy6 opened this issue Jan 21, 2022 · 3 comments
Open

≥ in rownames #38

rxy6 opened this issue Jan 21, 2022 · 3 comments

Comments

@rxy6
Copy link

rxy6 commented Jan 21, 2022

Is it possible to include the ≥ symbol in rownames? I've tried just including it in the spreadsheet that I read in (resulted in just "=" being printed), using the unicode character (\u2265), and using expression/bquote. None of them worked. Thanks!

@rdboyes
Copy link
Owner

rdboyes commented Jan 21, 2022

Hi - can you provide a reprex?

@rxy6
Copy link
Author

rxy6 commented Jan 24, 2022

In the example the row name should be Age ≥ 50, but in the plot, it's Age =50. I've seen this problem reported elsewhere with various fixes, but none of them seem to have fixed the issue here.

res <- readxl::read_xlsx(path = "ExampleResults.xlsx",
                                                 trim_ws = FALSE, sheet = 1)
#> New names:
#> * `` -> ...5
res$`Row %` <- sprintf(round(res$Positive/res$Total*100,1), fmt = "%#.1f")
res$`Row %`[res$`Row %` == "NA"] <- ""
names(res)[5] <- "   "

forester::forester(res[,1:5],
                                     estimate = res$`VE %`,
                                     ci_low = res$LowerCI,
                                     ci_high = res$UpperCI,
                                     null_line_at = 100,
                                     xlim = c(0,100),
                                     estimate_col_name = "VE % (CI)",
                                     estimate_precision = 0,
                                     font_family = "sans",
                                     ci_sep = "-",
                                     justify = c(0,1,1,1,1,1),
                                     nudge_height = 0.1,
                                     nudge_width = 0.2,
                                     render_as = "pdf",
                                     file_path = "ExampleForestPlot.pdf"
)


#> [1] 0

Created on 2022-01-24 by the reprex package (v2.0.1)
ExampleResults.xlsx
ExampleForestPlot.pdf

@rxy6
Copy link
Author

rxy6 commented Sep 20, 2022

We found a workaround for this issue. This way if the ≥ symbol is in the results file, it won't be replaced with just a > symbol in the plots. Still doesn't plot the symbol however, so still work to do here.

Encoding(res$Subgroup) <- "UTF-8" # first column
res$Subgroup <- gsub(pattern = \u2265", replacement = ">=", res$Subgroup)

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