-3

I've following code :

table_final = data.frame(table1$Text, table1$value,table2$value, table3$value) 
hist(table_final$Positive,col=rainbow(10))
hist(table_final$Negative,col=rainbow(10)) 
hist(table_final$Score, col=rainbow(10))

slices <- c(sum(table_final$Positive), sum(table_final$Negative)) 
labels <- c("Positive", "Negative") 
library(plotrix) 
pie3D(slices,labels = labels,col=rainbow(length(labels)),explode=0.00,main="Sentiment Analysis")

I'm getting following error :

hist(table_final$Positive, col=rainbow(10))

Error in hist.default(table_final$Positive, col = rainbow(10)) : 
  'x' must be numeric

hist(table_final$Negative, col=rainbow(10))

Error in hist.default(table_final$Negative, col = rainbow(10)) : 
  'x' must be numeric

hist(table_final$Score, col=rainbow(10))
  Error in hist.default(table_final$Score, col = rainbow(10)) : 
  'x' must be numeric

pie3D(slices, labels = labels, col=rainbow(length(labels)),
      explode=0.00, main="Sentiment Analysis")

Error in seq.default(start, end, by = angleinc) : 
  'to' must be a finite number

Please Help !!

neilfws
  • 32,751
  • 5
  • 50
  • 63
Aman Verma
  • 549
  • 7
  • 11
  • 2
    Please provide some *sample data*, using techniques suggested https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example or https://stackoverflow.com/help/mcve. (This includes both `table_final` and `labels`.) – r2evans Nov 23 '17 at 21:12

1 Answers1

0

For the histogram, try

as.numeric(table_final$Positive)
stevebroll
  • 175
  • 1
  • 8