Friday, 23 August 2013

how to plot graph using ggplot in R

how to plot graph using ggplot in R

i have data frame which contains Quarter and Unique Customer ID columns
what i want is plot a graph which will count the Unique customers by
Quarter.
what i tried is
uniquegraph<-data.frame(uniqueCustomerdf)
> uniqueCustomer<-c(uniquegraph$Customer.Id)
> Quarter<-c(uniquegraph$Quarter)
> uniquegraphplot<-data.frame(uniqueCustomer=uniqueCustomer,Quarter=Quarter)
> ggplot(mygraphdf,aes(x=myquarter,y=totalunitprice)) +
geom_bar(stat="identity")
and also i tried hist
hist(uniqueCustomer, plot=TRUE)
but here how to assign Quarter i am not getting

No comments:

Post a Comment