Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ALL the answers must be using R language. Create and print a vector x with all integers from 1 to 80 and a vector y

ALL the answers must be using R language.

  1. Create and print a vector x with all integers from 1 to 80 and a vector y containing multiples of 3 in the same range. Hint: use seq()function. Calculate the difference in lengths of the vectors x and y. Hint: use length().
  2. Create a new vector, x_square, with the square of elements at indices 1, 3, 5, 7, 9, 15, 20, 23, 24, and 29 from the variable x. Hint: Use indexing rather than a for loop. Calculate the mean and median of the FIRST five values from x_square.
  3. To convert factor to number, would it be correct to use the following commands? Explain your answer. factorVar <- factor(c(1, 6, 5.4, 3.2)) as.numeric(factorVar)
  4. A comma-separated values file dataset.csv consists of missing values represented by Not A Number (NaN) and question mark (?). How can you read this type of files in R?
  5. Compute n=150n!3n And n=222(3n+3n3)
  6. Describe what the following R command does: c(0:5)[NA]
  7. What is the difference between is.vector() and is.numeric() functions?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Combinatorics And Graph Theory

Authors: John M Harris, Jeffry L Hirst, Michael J Mossinghoff

2nd Edition

0387797114, 9780387797113

More Books

Students also viewed these Mathematics questions

Question

2. Find five metaphors for communication.

Answered: 1 week ago