0

I am new to R. I have a dataframe qtr_1

I am trying to draw a 3D pie chart for the same using the code

qtr_1 <- sqldf::sqldf('Select Tier, Sales2016 from final_table where Quarter = 1')
qtr_1 <- qtr_1 %>% group_by(Tier) %>% summarise(sales_2016 = sum(Sales2016))
qtr_1 <- pie3D(qtr_1$sales_2016,labels = qtr_1$Tier, explode=0.1, col=rainbow(length(qtr_1$Tier)),
                 main="Qtr 1")

I get the error:

Error in if (by == 0 && del == 0) return(from) : missing value where TRUE/FALSE needed

is.na(qtr_1) gives false for all.

If some help me out with this please. Thanks in advance.

Claudiu Papasteri
  • 2,469
  • 1
  • 17
  • 30
A. Boral
  • 3
  • 3
  • 1
    Please don't make a 3D pie chart. – Dason Jan 24 '19 at 15:42
  • @Dason when I try pie(qtr_1) I get Error in pie(qtr_1) : 'x' values must be positive. – A. Boral Jan 24 '19 at 15:45
  • What happens if you drop the 'out' group. But also... please don't make a 3D pie chart. – Dason Jan 24 '19 at 15:53
  • I just require a simple pie chart for that data, so since you since I am going without the pie 3D chart. @Dason – A. Boral Jan 24 '19 at 15:57
  • Hello, @Dason appreciate your time and patience. Well, the Tier was a factor and earlier I tried to change it to a character and draw a pie but I failed but this time it worked. So I am good and it is all up and running. Have a great day ahead. – A. Boral Jan 24 '19 at 16:11

0 Answers0