I'd like to plot a bar graph showing frequency of a string in ggplot. The input file (t1. txt) looks like:
do 4
re 2
mi 5
and my current r script is:
library("ggplot2")
t1<-read.table("t1.txt",header=FALSE,sep='\t')
ggplot(t1,aes(V1))+geom_bar()
However this isn't what I'd like - it has a correct x axis, but the y axis should show the variable from the second column (V2). Can anyone help? Thanks.