You are on page 1of 3

I am so sorry for the quality of work I am currently submitting

# INSTRUCTIONS:

# Read through the questions carefully and answer all questions listed below. You will submit
the questions and answers
# in a Microsoft Word document to the Homework 1 folder on Canvas before the due date (see
date listed on Canvas)

#Q1. Setting a working directory is the first step when starting an analysis in R. What are the
two methods you

Type function then press enter, now name what you may need help with

Secondly, you can look up PDF manuals in software

#Q2. Why is it necessary to set a working directory (i.e. what does setting a working directory
allow R to do?)? (1pt)

So you can find all the data in the specified files

#Q3. How do you install packages? List the steps below so that someone who has never used
R could follow them. (1pt)
Look for the package, You would write ‘install.package’

#Q4. Why do you need to install packages AND run the library function? What are each of these
steps doing? (2pts)
It is embedded into the environment/current session

#Q5. How do you create an object in R (i.e. what operator allows you to do this)? Provide an
example below to
# assign a value of 24 to object "t". (2pts)

Objects are
#Q6. How do you search for help with a function within R Studio? (HINT: there are multiple
ways to do this, but the easiest involves adding a single symbol to the function you need help
with) (1pt)

Go to help bar, then, ‘R function (text)’


#Q7. Explain the difference between the following two lines of code (HINT: what does adding
parentheses do to the output?). (1pt)

1:15-3
1:(15-3)

You need to ALWAYS need to add parentheses to your functions, one is correct and the other is
not.

#Q8. What does the function seq() do? What do each of the numbers inside the function
represent? (2pts)
seq(1,10,2)

I believe that they signify vectors, but I am not entirely sure.

#Q9. How does the function seq() differ from using c() to make lists of numbers? Provide an
example of when each would
# be useful to use. (2pts)

#Q10. How do you import data into R (HINT: what code do you use?)? What does each part of
the code do? (2pts)

#Q11. What code do you use to select only a row from a dataset? Demonstrate how you would
do this below for
# an imaginary dataset called "prairie" to select the 11th row called "bluestem". For this same
code that you write,
# list one alternative way to accomplish this same task (HINT: we used three different methods
to do this in lab). (1pt)

#Q12. If you wanted to select a column titled "percent.cover" from the same dataset as Q11,
what code would you use? (1pt)

#Q13. Now, you are interested in calling up the value for "percent.cover" from the "bluestem"
site in your "prairie"
# dataset. What code would you use to do this? (1pt)
#Q14. Finally, complete the code below to plot the "percent.cover" data as your dependent
variable, and your
# "soil.nitrogen" data as your independent variable (HINT: fill in where there are blank spaces
like this: ______)
# Note - you do NOT need to plot anything. (1pt)

You might also like