Question: in R code: ( 2 points ) The following gives a vector of - 1 ' s , 0 ' s , and 1 '

in R code:
(2 points) The following gives a vector of -1's,0's, and 1's.
>c(0,1,-1,0,1,-1,0,1,-1,0,1)
>rep(-1:1,4)[-1]
Give two more approaches that return the same vector without using the functions ),
rep(), and append().
(2 points) Convert the vector you created in #1 into the following character string:
b c a b c a b c a b c
(2 points) Convert the vector you created in #1 into the following logical vector:
FALSE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE
(2 points) Let {x1,dots,xn} be a sample of size n. Type the formula for the sample standard
deviation, and center the equation by writing it within double dollar symbols.
(2 points) The ) function in R calculates the standard deviation of a sample. Use this
function to compute the standard deviations for the variables "miles per gallon" (mpg),
"number of cylinders" (cyl), and "displacement" (disp) within the mtcars dataset.
in R code: ( 2 points ) The following gives a

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!