What is the function used in R to create bins for a variable myData$x1?
Added by Katherine H.
Step 1
If you want to use the `cut` function, you don't need any additional libraries, as it is part of base R. Show more…
Show all steps
Your feedback will help us improve your experience
Sri K and 79 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Suppose in R, we have a vector of real numbers x. Write R code to divide x up into 4 equally spaced bins, and count the number of elements of x that lie in each bin, and store these counts in a vector y (i.e., y should have four elements: the first element should be the count for the first bin, and the second element should be the count for the second bin, and so on). The first bin should have the left extent given by the minimum value of x and the last bin should have the right extent given by the maximum value of x. The bins must exclude their left end-point, and include their right end-point. Provide your code, and also create 2 small examples (versions of x) using any values you like, demonstrating that the lines of code meet the requirements.
Sri K.
Calculate a bin width that would form 8 uniform intervals for the following data. Graph the following data. 25, 64, 35, 35, 76, 35, 47, 81, 43, 73, 18, 36, 85, 49, 15, 84, 11, 75, 25, 54, 15, 87, 45, 79, 16, 80, 22, 74, 36, 70, 21, 75, 83, 27, 86, 19
Daniel S.
We create a frequency distribution for interval data by counting the number of observations that fall into each of a series of intervals, called?
Adi S.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD