-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path2 - Mini-challenges.R
56 lines (38 loc) · 1.15 KB
/
2 - Mini-challenges.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
44
45
46
47
48
49
50
51
52
53
54
55
56
# Mini-challenges (20 minutes)
# ---- Warning and Error messages ----
# detach the tidyverse package, so we can begin with a clean workspace:
detach("package:tidyverse", unload = TRUE)
# What do the following warning and error messages mean
# 1
plantgrowth
## Error: object 'plantgrowth' not found
# 2
ggplot2(mtcars, aes(mpg, wt)) +
geom_point()
## Error in ggplot2(mtcars, aes(mpg, wt)) :
## could not find function "ggplot2"
# 3
ggplot(mtcars, aes(mpg, wt)) +
geom_point()
## Error in ggplot(mtcars, aes(mpg, wt)) :
## could not find function "ggplot"
# 4
mtcars(5)
# Error in mtcars(5) : could not find function "mtcars"
# 5
mtcars[5](5)
# Error: attempt to apply non-function
# 6
subset[5]
## Error in subset[5] : object of type 'closure' is not subsettable
# 7
1:30 * 101:104
## Warning message:
## In 1:30 * 101:104 :
## longer object length is not a multiple of shorter object length
# ---- Mini-challenge I - Importing difficult data structures ----
# remove the header:
# find the end of the data:
# read only until the end.pos:
# ---- Mini-challenge II: Dealing with type mismatches ----
# What are the current problems with the data?