atlas-aai / ratlas

Custom graphics and report generation for @atlas-aai
https://ratlas.netlify.app
28 stars 8 forks source link

adding factor levels for percentage values #50

Closed JeffreyCHoover closed 2 years ago

JeffreyCHoover commented 2 years ago

Adding an object for creating factor levels for percentage values in aliases.R. This object allows for differentiating between 0% and <1% when printing output

JeffreyCHoover commented 2 years ago

@wjakethompson To explain why I put this together, I was able to use this to address one of Amy's comments for the topic guide so that we can differentiate between 0% and <1% when we're printing output to the pdf, html, or docx

wjakethompson commented 2 years ago

See my comment in the TM. This functionality already exists in some of the formatting functions. For example fmt_prop_pct() will take a decimal, multiply by 100 and round to the specified number of digits. If rounding results in 0, then < 1 is returned (or < .1, < .01, etc., depending on the number of digits specified).