Please help me to solve this question in R I need all steps
Please help me to solve this question in R. I need all steps and R-code. Thank you
Please help me to solve this question in R. I need all steps and R-code. Thank you
Solution
You did not provide the data so i cannot give you the output. But the generic R-code is as follows
Let f_i denote the frequency of ith class and N be the total frequency. Then relative frequency in R can be computed as follows, say we have k classes
rel.freq=rep(0,k)
hair colour=c(\"brown\",\"blue\",\"violet\",\"palegreen\")
for(i in 1:k)
{
rel.freq[i]=f[i]/N
}
barplot(rel.freq,x=hair color, colours=c(\"saddlebrown\",\"lightblue\",\"violet\",\"palegreen\")
legend(hair color,rel.freq,legend=\"\")
