No.of Litecoin No. of bitcoin
0 5
1 1
3 0
0 0
0 3
3 1
0 0
I need to plot a piechart and a bar chart that shows the given variable and it's frequency.
I know this looks simple to many of you but it would mean a lot to a beginner like me
CodePudding user response:
2 exemples of solutions :
out <- data.frame(my_col = c("One", "One", "Two", "Two", "Others"))
#Transform data
df <- data.frame(table(out$my_col))
names(df) <- c("label", "value")
#Plot with R-base
pie(df$value, df$label)
barplot(value~label, df)
#Plot with package
library(rAmCharts)
amPie(df)
amBarplot( "label", "value", df)
For more exemples you can go on Graphs gallery
