Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# 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
# 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 Q # Use R to multiply by
# CG Q # In a single line, create a vector that consists of the numbers and name it vec, and print its contents.
print vec c
# CG Q # Use the length function on vec to return the number of entries in vec.
lengthvec
# CG Q # Use the mean function on vec to find the average of the numbers in vec.
mean vec
# CG Q # Add to every entry of vec.
vec
# CG Q # Type a line of code that returns TRUE for an entry of vec being equal to and a FALSE otherwise vec
# CG Q # Now use the sum function on your logical vector from Q to count the number of in vec.
# CG Q # Use the which function on vec to return the positions of within the vector.
which vec
# CG Q # In a single statement, take the natural log of every entry of vec, name this object logVec and print the results.
print
# CG Q # Use the exp function on logVec to return the raw values of vec.
f
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started