Question: # In doing this assignment, you will demonstrate some basic functionality of R . # Use what you learned in lecture to complete this assignment.

# In doing this assignment, you will demonstrate some basic functionality of R.
# Use what you learned in lecture to complete this assignment.
# For each question, type your answer on the line that follows the question prompt.
# CG Q1 # Use R to multiply 36 by 27.
36**27
# CG Q2 # In a single line, create a vector that consists of the numbers 1,6,7,10, and 6, name it vec, and print its contents.
print (vec - c(1,6,7,10,6
# CG Q3 # Use the length function on vec to return the number of entries in vec.
length(vec)
# CG Q4 # Use the mean function on vec to find the average of the numbers in vec.
mean (vec)
# CG Q5 # Add 2 to every entry of vec.
vec+2
# CG Q6 # Type a line of code that returns TRUE for an entry of vec being equal to 6 and a FALSE otherwise vec==6
# CG Q7 # Now use the sum function on your logical vector from Q3 to count the number of 6s in vec.
)==(6
# CG Q8 # Use the which function on vec to return the position(s) of 6 within the vector.
which vec ==6
# CG Q9 # In a single statement, take the natural log of every entry of vec, name this object logVec, and print the results.
print (log(vec))
# CG Q10 # Use the exp function on logVec to return the raw values of vec.
f
 # In doing this assignment, you will demonstrate some basic functionality

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 Databases Questions!