logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Ivor CutlerLaw
(5/5)

844 Answers

Hire Me
expert
Gabriel WalkerHistory
(5/5)

996 Answers

Hire Me
expert
Peter BernerGeneral article writing
(5/5)

649 Answers

Hire Me
expert
Bill BaileyLaw
(5/5)

506 Answers

Hire Me
Biostatistics
(5/5)

Show the R code needed to create each of the following vectors.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

HW #1; 20 pts

2 point penalty each day late

Assigned homework should be turned by the end of day listed on Blackboard. Provide your R code and/or figures along with your answer below each exercise. Make sure that your answers are not in bold so that I can easily differentiate between your answer and my question.

Exercise 1

Use R as you would a calculator to find answers to the following (be sure to report R code):

i. (92-63)*(3/4)

ii. (3+13) / 42

Exercise 2

Show the R code needed to create each of the following vectors. Use the seq function for vec2 and rep function for vec3. (Hint: use the “?rep” function in R to see the documentation and examples for the rep function.)

vec1:     henry       johnson      jackson       clay       bates       nevada

vec2:         5                10               15             20           25             30

vec3:         4                 4                 4               8             8               8

Exercise 3

Use the data.frame command to put the individual vectors from exercise 2 (vec1, vec2, and vec3) into a single data frame named exer3. Report the R code as your answer.

Exercise 4

Rename the column names in exer3 to ‘county’, ‘precip’, and ‘temp’.

Exercise 5

The measurements for the precip column in exer3 are in centimeters. Convert these measurements to millimeters by creating a new column in the exer3 data frame and label it ‘precipmm’. (Hint: values in ‘precipmm’ should be larger than in ‘precip’ by a factor of 10).

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme