R Programming Assignment Help

Part 1: Answer the following questions (practice with R where you can):

a.       Which of the following is a logical operator?

Get Your Custom Essay Written From Scratch
We have worked on a similar problem. If you need help click order now button and submit your assignment instructions.
Just from $13/Page
Order Now
/ | - ^

b.       What value does R return in the statement below?

3 >= 4

c.        What is the result of this calculation?

(45 + 3) * 43 + 3^2

d.       How would R evaluate the following?

carspeed = 70
speedlimit = 65
carspeed > speedlimit

e.       How would R evaluate the following?

(2+2 == 4) | (2+2 == 5)

f.         How would R evaluate the following?

!FALSE

g.       What is the result of this function?

round(33.2321435452, 2)

h.       What is the result of this function?

sqrt (64)

i.            What is the result of these statements?

sqrt(64) == 64 ^.5
abs(-32)

k.        Which of the following is an arithmetic operator?

*, |, &, !

l.         What is wrong with this code?

2 +     3 *4 + sqrt[100]

Complete the following a R Markdown document what you are doing using comments.

Part 2: Write an R Script:

 

a)       create a vector called unemploy_rate with 12 values, one for each month in 2013. The values for each month are listed below (beginning with January’s rate of 7.9)

7.9 7.7 7.5 7.5 7.5 7.5 7.3 7.2 7.2 7.2 7.0 6.7

a.       create a vector called month and add 12 values, one for the name of each month in a year.

Jan Feb Mar Apr May Jun July Aug Sep Oct Nov Dec

b.       convert month to a factor variable

c.       create a data frame called monthly_rate that is comprised of unemploy_rate and month.

d.       How would you extract the unemployment rate for March?

e.       Extract only those months where unemployment was below 7.5%.

Upload your script

 

 

Part 3: Write the R Scripts:

a)       Create a folder on your desktop called mydata

b)      Create a new R Script in RStudio named BUSI 4063_Yourname_fed_stimulus.R

c)       Add comments to your script that include your name and date

d)      Go to NYC Open Data and export the Federal Stimulus dataset as a CSV file from https://data.cityofnewyork.us/Business/Federal-Stimulus-Data/ivix-m77e

e)      Review the details of the variables included in the dataset by selecting the manage button on the NYC Open Data site for the Federal Stimulus data.

f)        Download the Federal_Stimulus_Data.csv file to your mydata folder on your local desktop

g)       Import the dataset in RStudio.

h)      Change the name of the data frame from Federal_Stimulus_Data to DF_Yourname_fed_stimulus

i)        Compute the sum and mean for the payment value column

j)        Create a subset of your data that includes those projects with project status equal to the completed 50% or more (Do not include fully completed projects).

k)       Review your R Script and add appropriate explanatory comments

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *