coopercenter / cte-trailblazers

MIT License
0 stars 0 forks source link

Create a single function to generate job growth plots #33

Open athena-small opened 2 years ago

athena-small commented 2 years ago

Currently the code to generate job growth plots (Figure 2) uses a slightly different formulation for each of the seventeen career clusters. This structure is bad for two reasons: (1) it means that any changes to the plot design has to be implemented seventeen times; and (2) the particular formulation is fragile: It depends on the specific values in the data.

The task: Revise ./r/make-cluster-plots.Rmd to create a single function to generate a job growth plot that is robust -- that works for all clusters and for any reasonable data values.

At present each of the seventeen cluster-specific code chunks includes a kludge: a parameter value is set manually to make the plot generate properly:

expand_limits(x = <x_max>)

In the code, the value of <x_max> has been set manually -- apparently, through a process of trial-and-error -- to make the plot generate properly. Values of this parameter that work are specific to the particular data values for that cluster. If different parameter values are set, or if the above line is deleted, the plot either fails to generate properly, or throws an error.

Completing this task will involve researching into the documentation for ggplot() to understand more deeply the sources of this error.

athena-small commented 2 years ago

Relates to #16 .