r programming 5th program
r programming 5th program
. Write an R program to draw i) Pie chart ii) 3D Pie Chart, iii) Bar
Chart along with chart legend by considering suitable CSV file
Procedure:
1. pie chart:
i. Create the Data:
• We first define two vectors: Category and Value.
• Category contains names of different fruits.
• Value represents some numeric value associated with each fruit.
• Create a Data Frame:
We then combine the Category and Value vectors into a data frame called data.
Program:
# Create data
Category <- c("Apples", "Bananas", "Cherries", "Dates", "Elderberries",
"Figs", "Grapes", "Honeydew", "Indian Fig", "Jackfruit")
Value <- c(15, 25, 10, 30, 5, 20, 35, 10, 5, 45)
Program: