-
Notifications
You must be signed in to change notification settings - Fork 5
/
possible_dog_part4.R
43 lines (34 loc) · 1.22 KB
/
possible_dog_part4.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
### Beginner Task ###
# Fill in the blanks in the docstrings
# Discuss what changes you made with other group members.
# https://www.guinnessworldrecords.com/news/2019/4/a-history-of-the-biggest-and-smallest-dog-breeds-from-giant-great-danes-to-tiny
#' Check if animal is likely a dog
#'
#' @param height_cm Integer. Dog's height from floor to shoulder, rounded to the nearest centimeter.
#' @param has_fur Boolean. [INSERT DESCRIPTION HERE]
#'
#' @return List. Animal's parameters and a boolean indicating [FINISH THIS SENTENCE]
#'
#' @examples
#' \dontrun{dogCheck(height_cm = 50, has_fur = TRUE)}
dogCheck <- function(height_cm, has_fur) {
params <- paste0("Fur:", has_fur, ", Height (cm):", height_cm)
if(has_fur == TRUE){
if(height_cm < 112 & height_cm > 9){
possible_dog <- TRUE
}
} else {
possible_dog <- FALSE
}
return(list("Dog Parameters" = params, "Possibly a Dog" = possible_dog))
}
dogCheck(height_cm = 50, has_fur = TRUE)
### Advanced Task ###
# Begin with the function you created in Parts 1-3.
# Add docstrings to explain what it does.
# Don't forget the inputs and returns!
# If you have time, explain your code to other group members.
myFunction <- function(){
return()
}
myFunction()