Question: R Exercises Sampling Letters The built - in vector letters contains the 2 6 lower - case letters of the alphabet. a . Using the

R Exercises
Sampling Letters
The built-in vector letters contains the 26 lower-case letters of the alphabet.
a. Using the sample() function, take a sample of 10 letters without replacement from letters .
b. Using the ` sample() function, take a sample of 10 letters with replacement from letters .
Sampling Letters (continued)
a. Write a function to take a sample of 10 letters without replacement from letters .
b. Add a line in the function so that the function returns the number of vowels in the sample. (If the sample is stored in
the vector y, then the line of code
sum(y %in% c("a","e","i","o","u"))
will count the number of vowels in the sample.)(c) Using the function replicate(), take 50 samples, storing the
number of vowels from the samples in the vector n-vowels .(d) Approximate the probability that there are two vowels in
your sample.
R Exercises Sampling Letters The built - in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!