Question

## Read directions carefully - USING THE PROGRAMMING LANGUAGE R AND R STUDIO ## Please complete...

## Read directions carefully - USING THE PROGRAMMING LANGUAGE R AND R STUDIO

## Please complete all three problems
## If you exceeded the one line requirement (question 1 and 2) but complete the code successfully, you will only earn half of the points.

## Problem 1. (1 points)
## Using the vector x below, express the Euclidean norm of x.
## Recall that the Euclidean norm of a vector v = <v1, v2, ..., vn>
## is the square root of the sum of the squares of it's terms, i.e
## sqrt(v1^2 + v2^2 + ... + vn^2)
## Complete the problem using one line only.
x <- c(4,2,8,6,4,9,2,4,1,6,4)
## BEGIN YOUR CODE HERE ##

## END YOUR CODE HERE ##

## Problem 2.(2 points)
## Using the vector x below, divide every element in
## an even index by two, without modifying the elements in odd indices.
## Complete the problem using one line only.
## If you exceeded the one line requirement but complete the code successfully, you will only earn half of the points.
## Hint you do not need a loop. This will work with a multiplication.
x <- 1:10
## BEGIN YOUR CODE HERE ##

## END YOUR CODE HERE ##
## ------------------------------------------------------------------------

##Problem 3 (2 points)
##Repeat problem 2 but make your one line general enough that it works regardless of vector length.
##Hint you may want to use an 'if' and 'else' and note they can still be in one line.

x <- 1:10
##Begin your code here

##End your code here
x

x <- 1:13
##Insert your same code here

##End your code here
x

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
## Read directions carefully - USING THE PROGRAMMING LANGUAGE R AND R STUDIO ## Please complete...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Let V be a finite dimensional vector space over R with an inner product 〈x, y〉 ∈ R for x, y ∈ V . (a) (3points) Let λ∈...

    Let V be a finite dimensional vector space over R with an inner product 〈x, y〉 ∈ R for x, y ∈ V . (a) (3points) Let λ∈R with λ>0. Show that 〈x,y〉′ = λ〈x,y〉, for x,y ∈ V, (b) (2 points) Let T : V → V be a linear operator, such that 〈T(x),T(y)〉 = 〈x,y〉, for all x,y ∈ V. Show that T is one-to-one. (c) (2 points) Recall that the norm of a vector x ∈ V...

  • The plane passing through the 3 points A(4, -2, 1), B(4, -1,4) and C(1,-4,2) can be...

    The plane passing through the 3 points A(4, -2, 1), B(4, -1,4) and C(1,-4,2) can be expressed as a parametric vector equation of the form x a 1V+ 12v2 where 1 and d2 are real parameters. You are given that V1 Find suitable vectors a and V2 and enter them in the boxes below. You must enter your answers using Maple notation, for example, the vector \(\begin{pmatrix}1\2\\3\end{pmatrix} is entered as <1, 2, 3>. a = Your response Correct response No...

  • Using Rstudio please provide your code as well as a screenshot of your code ## File:...

    Using Rstudio please provide your code as well as a screenshot of your code ## File: lab5 ## Author: A. Breitzman ## Description: Manipulating and summarizing a data set ## ------------------------------------------------------------------------ ## Instructions: This worksheet is worth 5 points ## Exercises are worth 2.5 point each. If you cannot get the code to work in the line limits specified, the maximum that you can earn per exercise would be 1.5 points. ## First we need to load a library library(MASS)...

  • Directions: Carefully read and respond to each question. Please complete your responses using complete sentences. Your...

    Directions: Carefully read and respond to each question. Please complete your responses using complete sentences. Your responses will be evaluated on the basis of content accuracy, clarity, correct usage of the English language, and demonstrated evidence of critical analysis.   6.    What do you think is the most pressing public health issue in the United States? How would you address this problem?

  • Directions: Carefully read and respond to each question. Please complete your responses using complete sentences. Your r...

    Directions: Carefully read and respond to each question. Please complete your responses using complete sentences. Your responses will be evaluated on the basis of content accuracy, clarity, correct usage of the English language, and demonstrated evidence of critical analysis.   13. Healthcare spending does not necessarily translate to better health outcomes. Why do you think that is the case?​

  • Directions: Carefully read and respond to each question. Please complete your responses using complete sentences. Your r...

    Directions: Carefully read and respond to each question. Please complete your responses using complete sentences. Your responses will be evaluated on the basis of content accuracy, clarity, correct usage of the English language, and demonstrated evidence of critical analysis.   9.    Do you think the consumer culture in the United States has a positive or negative effect on public health overall? Why?

  • ***PLEASE HELP!!!*** PLEASE READ INSTRUCTIONS CAREFULLY ANF PLEASE THOROUGHLY COMPLETE. Will reward full points! PROGRAMMING LANGUAGE:...

    ***PLEASE HELP!!!*** PLEASE READ INSTRUCTIONS CAREFULLY ANF PLEASE THOROUGHLY COMPLETE. Will reward full points! PROGRAMMING LANGUAGE: JAVA Thank you in advance. Summary Now for something a little different In a hypothetical world, a new mobile game emerges where players "collect" digital characters called "Digit The players start out with a selection of Digitoids oids (specific to the region of world they began at) from which they choose one to be their first Digitoid However, players can also visit famous landmarks...

  • Directions Carefully read and respond to each question. Please complete your responses using complete sentences. Your...

    Directions Carefully read and respond to each question. Please complete your responses using complete sentences. Your responses will be evaluated on the basis of content accuracy, clarity, correct usage of the English language, and demonstrated evidence of critical analysis.   1.     How would you describe the “culture of healthcare” in the U.S.? Do you agree that a country’s culture determines its healthcare model? Explain your opinion.

  • PLEASE ANSWER WITH CLEAR PROCESS AND DETAILS V1= 8v V2= 16 Student Instructions: 1) Procedures: Using...

    PLEASE ANSWER WITH CLEAR PROCESS AND DETAILS V1= 8v V2= 16 Student Instructions: 1) Procedures: Using the following circuit models, modify the value of the voltage source ur I number as follows: Define the value of the left side voltage source as V1 and the right side voltage source as V2, where Vi= the sum of your first 3 digt of your D number and V2 = the sum of the rest of your ID number. (Example:If the ID. number...

  • Problem on Linear programming and Simplex method

    Problem on Linear programming and Simplex methodThe \(\ell_{1}\) norm of a vector \(v \in \mathbb{R}\) is defined by$$ \|v\|_{1}:=\sum_{i=1}^{n}\left|v_{i}\right| $$Problems of the form Minimize \(\|v\|_{1}\) subject to \(v \in \mathbb{R}^{n}\) and \(A v=b\) arise very frequently in applied math, particularly in the field of compressed sensing.Consider the special case of this problem whith \(n=3\),$$ A=\left(\begin{array}{lll} 1 & 1 & 0 \\ 3 & 0 & 1 \end{array}\right) \quad \text { and } \quad b=\left(\begin{array}{l} 3 \\ 8 \end{array}\right) $$(a) (3...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT