Best Answer · By JanBask Data Science Expert
Answered on Dec 10, 2019
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