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

package was working for me, tried to update, broken. #16

Closed
MMenninger opened this issue Jan 28, 2020 · 2 comments
Closed

package was working for me, tried to update, broken. #16

MMenninger opened this issue Jan 28, 2020 · 2 comments

Comments

@MMenninger
Copy link
Collaborator

library(cmapplot)
> economy_basic

A tibble: 18 x 4

variable year sector value

1 Jobs 2001 local 2175402
2 Jobs 2001 tradedgoods 440908
3 Jobs 2001 tradedservices 1153064
4 Jobs 2017 local 2482547
5 Jobs 2017 tradedgoods 312112
6 Jobs 2017 tradedservices 1137597
7 Real Earnings 2001 local 109373872297
8 Real Earnings 2001 tradedgoods 32443025020
9 Real Earnings 2001 tradedservices 98962528774
10 Real Earnings 2017 local 127029954775
11 Real Earnings 2017 tradedgoods 28297549664
12 Real Earnings 2017 tradedservices 111886397025
13 Establishments 2001 local 121282
14 Establishments 2001 tradedgoods 8159
15 Establishments 2001 tradedservices 53911
16 Establishments 2017 local 146391
17 Establishments 2017 tradedgoods 8550
18 Establishments 2017 tradedservices 59761

ggplot(cluster_jobchange, aes(x = reorder(name, jobchange), y = jobchange, fill = category)) +

  •  geom_col() +
    
  •  coord_flip() +
    
  •  cmapplot::theme_cmap()
    

Error in ggplot(cluster_jobchange, aes(x = reorder(name, jobchange), y = jobchange, :
object 'cluster_jobchange' not found

ggplot(cars) +

  • geom_point(aes(x=speed, y = dist)) +
  • style_cmap()
    Error in style_cmap() : could not find function "style_cmap"

a grouped and stacked bar chart (via interaction())

ggplot(economy_basic, aes(x = interaction(year, variable), y = value, fill = sector)) +

  • geom_col(position = "fill") +
  • scale_y_continuous(labels = scales::percent) +
  • theme_cmap()
    Error in theme_cmap() : could not find function "theme_cmap"
@MMenninger
Copy link
Collaborator Author

Sarah showed me how to fix. Need to specify package.
cmapplot:::theme_cmap()

This works:

a grouped and stacked bar chart (via interaction())

ggplot(economy_basic, aes(x = interaction(year, variable), y = value, fill = sector)) +
geom_col(position = "fill") +
scale_y_continuous(labels = scales::percent) +
cmapplot:::theme_cmap()

@nmpeterson
Copy link
Contributor

With PR #17 you should no longer need the cmapplot::

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