Question: using r studio We will write a version of the histogram function almost from scratch (some basic plotting functions will be assumed). If you struggle

using r studio
We will write a version of the histogram function almost from scratch (some basic plotting functions will be assumed). If you struggle with this ques- tion, please read the O'Reilly text Learning R, or chapter 11 of the course text book Automated Data Collection with R. Question la, (4 points): Cre- ate a function in R named counts. This function should take as parameters a numeric vector x and also a number indicating a number of bins n. The function will consider the range min (2), max(2)], and then consider a parti- tion of this interval into n non-overlapping equally sized half open intervals: 11 = (min(2), b), 12 = [b1,b 2), ..., In = [bn-1, max(x)). Note that since the intervals are equally sized, the value of b is constrained. The function will then return a vector of length n such that the i-th element of this vector is the number of coordinates of x that lie in the interval I. Provide the code for this function: It should be of the following form: counts = function(...){ return( ... ) We will write a version of the histogram function almost from scratch (some basic plotting functions will be assumed). If you struggle with this ques- tion, please read the O'Reilly text Learning R, or chapter 11 of the course text book Automated Data Collection with R. Question la, (4 points): Cre- ate a function in R named counts. This function should take as parameters a numeric vector x and also a number indicating a number of bins n. The function will consider the range min (2), max(2)], and then consider a parti- tion of this interval into n non-overlapping equally sized half open intervals: 11 = (min(2), b), 12 = [b1,b 2), ..., In = [bn-1, max(x)). Note that since the intervals are equally sized, the value of b is constrained. The function will then return a vector of length n such that the i-th element of this vector is the number of coordinates of x that lie in the interval I. Provide the code for this function: It should be of the following form: counts = function(...){ return( ... )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
