Run »
# We need this line of code to show graphs in our compiler bitmap(file="out.png") # Create a vector of pies x <- c(10,20,30,40) # Create a vector of labels mylabel <- c("Apples", "Bananas", "Cherries", "Dates") # Create a vector of colors colors <- c("blue", "yellow", "green", "black") # Display the pie chart pie(x, label = mylabel, main = "Pie Chart", col = colors) # Display the explanation box legend("bottomright", mylabel, fill = colors)