Answered step by step
Verified Expert Solution
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.
- 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().
- 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.
- 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)
- 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?
- Compute n=150n!3n And n=222(3n+3n3)
- Describe what the following R command does: c(0:5)[NA]
- What is the difference between is.vector() and is.numeric() functions?
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