Question: Refer to Script 2.1 below: Statements in R. USING R (1 Point) Find the area of a circle with radius 10. (1 Points) Round the
- Refer to Script 2.1 below: Statements in R. USING R
- (1 Point) Find the area of a circle with radius 10.
- (1 Points) Round the area in part(a) to two decimal places.
- (1 Point) Assign FALSE to a variable, y, in R. What is the mode of y?
- (1 Point) Refer to part(c). Assign FALSE + 2 to y. What is the mode of y now?
- (1 Point) Refer to part(d). What is the current value of y?
#Script 2.1 Simple statements in R
# Here are a few R commands. # Comments do not continue from one line to the next.
getwd() # setwd("c:/Users/richa/desktop") # getwd()
x <- 5+10 # assign a value to x print(x) radius <- 3 area<-pi*radius^2 area area <- round(area,2) area cat("area=", area) y <-TRUE mode(y) y <- TRUE + 5 mode(y) cat(y) x<- c(1:10) x mean(x) median(x) length(x)
# For help type help with the name of the function help(cat)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
