Using R programming design a scatterplot • Using 50 Random Uniform numbers for X-axis and 50 Random Normal numbers for Y-axis • X-axis label: " Random Uniform " • Y-axis label: " Random Normal " • Save the output as "Quiz1.pdf"
Added by Katie H.
Close
Step 1
Generate 50 random uniform numbers for the X-axis using the `runif()` function: ```R x <- runif(50) ``` Show more…
Show all steps
Your feedback will help us improve your experience
Tanvi Garg and 89 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
Generate 100 random numbers from normal distribution with mean 5 and standard deviation 2. (Hint: use the function rnorm(), and you can search it in R for help) (a) Recode the 100 numbers that you generated at the beginning in the following way: If it is less than 0, code it as 0; if it is less than 5 but bigger than or equal to 0, code it as 1; if it is bigger than or equal to 5, code it as 2. (b) Make the recoded numbers as the second column, and combine it with the original numbers to create a data frame, call it "NormData". (c) Save the "NormData" created in part (b) as a ".txt" file. (d) Save the "NormData" created in part (b) as a ".RData" file.
Lucas F.
Code R to draw a histogram and density symmetric fitted line for the following set of numbers: X = (5, 5.5, 4.9, 4.8, 4.7, 5.2, 5.3)
Adi S.
Suppose you would like to use the ggplot2 package to draw a scatterplot showing the relationship between the variables "displ" (independent) and "hwy" (dependent) from the "mpg" data frame: What code would you use to map these variables to the frame? a. geom_point(x = hwy, y = displ) b. ggplot(aes(x = hwy, y = displ)) c. ggplot(aes(x = displ, y = hwy)) d. geom_point(x = displ, y = hwy) Suppose you draw a histogram using the ggplot2 package. You'd like to add a normal curve to the histogram. What geom would you use? a. geom_density() b. geom_gaussian() c. geom_smooth(model = GAUSSIAN) d. geom_normal()
T. L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD