Skip to content

Commit

Permalink
Adding homework 1 to beneath lab 1
Browse files Browse the repository at this point in the history
  • Loading branch information
njlyon0 committed Jan 23, 2024
1 parent f4743fe commit a8aab60
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions materials/home_week1.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,45 @@ title: "Week 1 Slide Decks"
```

[Lab Slides -- Full Screen](slides_1b.qmd)

## Homework 1

### Learning Objective(s)

Upon completion of these assignments, students will be able to:

- Describe a real-world file path
- Demonstrate comfortability with using comments in an R script
- Explain fundamental principles of R and RStudio
- Perform arithmetic using objects in R
- Manipulate and interpret vectors and objects of various classes and contents

### Assignment Due Date(s)

Each homework is due at midnight the day before each lecture (i.e., Monday night) Late work will be accepted but will be subject to the late assignments policy outlined in this course's syllabus.

### Assignment Description

This homework should be submitted as an R script with your last name and week 1 as the file name (e.g., "Lyon_week1.R"). Remember to specifically load any necessary packages using the `library` argument and include comments explaining what line(s) correspond to each of the following prompts.

1. As a comment, write the full file path on your computer to where you've saved this script. Folders should be separated by slashes. Include the name of the R script in the file path

2. As a comment, explain the difference between the RStudio "Console" and "Source" panes

3. As a comment, describe–in your own words–what is meant by the term "base R"

4. Create an object named "weight_kg" and assign the value 62 as a number

5. Create a new object by multiplying the 'weight_kg' object by 2.2 and assign the result to an object called "weight_lb"

6. As a comment, define both (A) the value of 'weight_lb' and (B) the class of 'weight_lb'

7. Write the code necessary to access the help file for the function `floor`

8. As a comment, define the argument(s) that the `floor` function accepts beneath your response to #7
- NOTE: this should include both (A) the name of the argument and (B) what class(es) the argument requires

9. Concatenate the following values into an object called "my_vector": 4, 8, 15, 23, "hello", "world"

10. Provide code to identify (A) the length of 'my_vector', (B) the class of my vector, and (C) what happens if you try to take the square root of 'my_vector'
- NOTE: For part C, explain why that outcome occurs when you attempt to take the square root of 'my_vector'

0 comments on commit a8aab60

Please sign in to comment.