Skip to content

Commit

Permalink
modify vignette file path
Browse files Browse the repository at this point in the history
  • Loading branch information
yukunzGIT committed Feb 4, 2023
1 parent 0787b1c commit 7bb0a74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
File renamed without changes.
18 changes: 10 additions & 8 deletions vignettes/gradecalculatorr-vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,30 @@ Next, let's explore the the function construct_course():
# 4 lab4 15 <NA>
# 5 quiz1 20 <NA>
# 6 quiz2 20 <NA>
csv_file <- system.file("extdata", "dsci524.csv", package = "gradecalculatorr")
```
Then, let's update the grades:

```{r update the grades}
update_component_grade('dsci524.csv', 'lab1', 90.15)
update_component_grade('dsci524.csv', 'lab2', 88.22)
update_component_grade('dsci524.csv', 'lab3', 86.65)
update_component_grade('dsci524.csv', 'lab4', 88.75)
update_component_grade('dsci524.csv', 'quiz1', 90.15)
update_component_grade(csv_file, 'lab1', 90.15)
update_component_grade(csv_file, 'lab2', 88.22)
update_component_grade(csv_file, 'lab3', 86.65)
update_component_grade(csv_file, 'lab4', 88.75)
update_component_grade(csv_file, 'quiz1', 90.15)
```
Then, let's calculate how well the quiz2 has to be in order to get 85% total for course 524:

```{r predict quiz2 grade}
predict_final('dsci524.csv', 85)
predict_final(csv_file, 85)
# > [1] 69.5
```

After quiz2, we know we get 90 for quiz2 and let's calculate the overall grade for course 524:

```{r calculate the overall grade}
update_component_grade('dsci524.csv', 'quiz2', 90.25)
calculate_grade('dsci524.csv')
update_component_grade(csv_file, 'quiz2', 90.25)
# calculate_grade(csv_file)
# > [1] "Course grade is 89.15%"
```

Expand Down

0 comments on commit 7bb0a74

Please sign in to comment.