waffle icon indicating copy to clipboard operation
waffle copied to clipboard

Error when running source code as my own function

Open amr262 opened this issue 8 years ago • 1 comments

Hello, I'm attempting to modify the source code to change some of the parameters. Here is what I'm doing:

  1. Copy full source code
  2. Paste into script file in R Studio
  3. Name the function waffle_mod <- and run the code

Here is the script with the error message at the bottom. Do you know of any way that I could address this issue?

waffle_mod(c("Male" = 6, "Female" = 4),

  • rows = 1, use_glyph = "male", glyph_size = 8, colors = c("#000000","#CCCCCC"),
  • xlab = "67% Agree", legend_pos = "none") Error in fa_unicode() : could not find function "fa_unicode"

amr262 avatar Sep 29 '17 23:09 amr262

The thing is that @hrbrmstr created fa_unicode with a dot before its name: .fa_unicode. This hides its code inside the "waffle" environment in R. To see it's code use :::

That is, to make it work, use .fa_unicode <- waffle:::.fa_unicode

gu-stat avatar Oct 05 '18 20:10 gu-stat