Skip to content

Commit

Permalink
Add missing () to if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwhite committed Oct 15, 2024
1 parent b53d760 commit bc0959c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions materials/conditionals-R.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ str_detect("grass A", "grass")

```r
est_mass <- function(volume, veg_type){
if str_detect(veg_type, "shrub") {
if (str_detect(veg_type, "shrub")) {
mass <- 2.65 * volume^0.9
} else if str_detect(veg_type, "grass") {
} else if (str_detect(veg_type, "grass")) {
mass <- 0.65 * volume^1.2
} else {
mass <- NA
Expand Down

0 comments on commit bc0959c

Please sign in to comment.