[R] Bar Graph

Jim Lemon jim at bitwrit.com.au
Wed Nov 13 09:30:19 CET 2013

On 11/13/2013 07:20 PM, Keniajin Wambui wrote:
> The serialno represents each individual in the data set.The total
> count of the serialno will represent the whole sample
>   I want to do a graph to compare the total data (serialno) vs each of
> the remaining five variables yearly. i.e to show the total data
> (serialno) vs available data for one of the variables in the above
> case temp axilla.
> The above code plot count of temp_axilla yearly,how can I include
> serialno to be part of the plot?
> I have used
> library(ggplot2)
> library(foreign)
> utils package

Hi Keniajim,
It is not easy to work out what you want. If each serial number is an 
individual and you want the total number of individuals (dataset is 


If you want the total number of individuals per year:

nind<-function(x) return(length(unique(x)))

Perhaps this will give you a start.


More information about the R-help mailing list