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
Adele AndersonLaw
(5/5)

832 Answers

Hire Me
expert
StatAnalytica ExpertStatistics
(5/5)

681 Answers

Hire Me
expert
Lesley RobertsGeneral article writing
(5/5)

926 Answers

Hire Me
expert
Rubina KhatoonFinance
(5/5)

979 Answers

Hire Me
R Programming
(5/5)

When I attach a package to my workspace using the library() function, I have to re-attach with the library() function (or similar) every time I start a new workspace

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

1- When I attach a package to my workspace using the library() function, I have to re-attach with the library() function (or similar) every time I start a new workspace.

A. True

B. False

 

2- When I install a package to my instance of R, I have to re-install every time I open a new instance of R (or RStudio).

A. True

B. False

 

3-Create a vector with the following code:

r <- runif(20)

This creates a vector of twenty elements that are random numbers between 0 and 1. Be advised, every time you run this code you will get a different set of numbers and your numbers are different than mine.

Using a for loop (and an if-statement), iterate through the vector and print out the elements of the vector that are greater than 0.5.

Place the code here.

 

 

Maximum number of characters (including HTML tags added by text editor): 32,000

 

4- Suppose you have the following vector: w <- 1:10

Using a for-loop, and any other control statements you find necessary, print out the values of the vector w that are odd.

That is, using a for-loop, iterate through the elements of w and print out the ones that are odd. That is the only requirement.

Place the code here.

 

Maximum number of characters (including HTML tags added by text editor): 32,000

 

5- Suppose you have three variables: x, y, and z. Suppose they could theoretically take on any value BUT they cannot/will not take on the same value. Create a series of nested if-else statements that output the order of x,y, and z in ascending order. That is, suppose the following:

 

x = 2

y = 4

z = 5

 

Then the if-else "tree" should ultimately print out "x,y,z".

But if the values were the following: 

x=7

y=4

z=5

Then the output would be: "y,z,x"

 

 

6- Import the dataset "Marine Reenlistment Data.xlsx". (Or "Marine Reenlistment Data.csv")  Either of which may be found at Resources -> Data. 

 

Create a new variable called Superior_PFT. This variable takes on a value of 1 if the individual's `Physical Fitness Test Score` is greater than or equal to 280, and 0 otherwise.

 

 

Maximum number of characters (including HTML tags added by text editor): 32,000

 

 

7- Create a subset of the data frame you create when you import the file above. This subset should contain all rows and the following columns: ID, Reenlisted, Present Grade, Occupational Field, and Civilian Education.

 

 

Maximum number of characters (including HTML tags added by text editor): 32,000

 

(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