Question: a . Construct a numeric vector named vec _ num containing the following values using the function ) . - 1 0 , - 8
a Construct a numeric vector named vecnum containing the following values using the function
b Perform the following operations and print your results:
i Raise vecnum to the power of
ii Raise to the power of vecnum.
iii. Using the function rep create a vector of repeated times named vecseven. Subtract vecseven from vecnum.
iv Use the following code to create a vector of Boolean vector of length named vecbool. Multiply vecnum by vecbool.
vecbool crepTRUE repFALSE
c Using the seq function with the by argument, define a vector object named vecseqby containing all integers between and that are multiples of three. Print only the first and last values using the following code:
printfirstandlastvecseqby
d Using the seq function with the length, out argument, define an ordered vector of numbers named vecseqen between and of length equal to the length of vecseqby Print only the first and last values using the following code:
printfirstandlastyecseqlen
How does this vector differ from the vector in c
e Try to define a vector with the seq vector using both the length and by arguments and comment on what happens.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
