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

Add function, change, which creates text statements about changes between two data points. #10

Open
anthonyokc opened this issue Sep 12, 2024 · 2 comments · May be fixed by #11
Open

Add function, change, which creates text statements about changes between two data points. #10

anthonyokc opened this issue Sep 12, 2024 · 2 comments · May be fixed by #11

Comments

@anthonyokc
Copy link

Basically simplify making statements like this

white_poverty_statement <- case_when(
  white_poverty_change$change > 0 ~ paste0(
    "increased by ",
    abs(white_poverty_change$change * 100),
    " percentage points to"
  ),
  white_poverty_change$change < 0 ~ paste0(
    "decreased by ",
    abs(white_poverty_change$change * 100),
    " percentage points to"
  ),
  TRUE ~ paste0(
    "remained unchanged at "
  )
@anthonyokc anthonyokc changed the title Add function change, which creates text statements about changes between two data points. Add function, change, which creates text statements about changes between two data points. Sep 12, 2024
@brancengregory
Copy link
Member

I propose describe_change as the function name

@anthonyokc
Copy link
Author

I also considered change_statement but, and this is a somewhat silly reason, but when I use it inline quarto docs like r change_statement() it doesn't autocomplete the function name so it's a lot to type lmao.

@brancengregory brancengregory linked a pull request Sep 12, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants