Average Function In R Studio