0

I cannot understand why I get the following error when creating a pie chart?

labels = c('payroll', 'wins')
pie(as.numeric(by(payroll,wins)),labels)

Error in FUN(dd[x, ], ...) : argument "FUN" is missing, with no default

payroll

400000 320000 500000

wins

50 24 53

Victor
  • 31
  • 1
  • 3
  • 1
    the error comes from the `by` part in your code. Please create a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). We have no idea what the variables payroll and wins are. – phiver Aug 04 '18 at 17:29
  • 1
    `by` needs a `FUN` argument (see `?by`); what did you expect `by(payroll, wins)` to do? At the moment you're telling R to do something with `payroll` by`wins` groups without specifying what that something this. – Maurits Evers Aug 05 '18 at 01:48
  • I only want to create a pie chart? is it possible to create a pie chart with two variables? Or I can create a pie chart with either payroll or wins? – Victor Aug 05 '18 at 02:19

0 Answers0