A cell phone bill varies from month to month and has the following monthly amounts 46,33,39,37,46,30,48,32,49,35,30,48.How to find out the months he spent greater than 40 dollars and the percentage of it?
Let us assign to a variable bill
bill=c(46,33,39,37,46,30,48,32,49,35,30,48)
sum(bill)
To get the months he spent greater than 40 dollars,
bill_40=sum(bill>40)
To get the percentage of it,
z=bill_40/length(bill)
z*100