Plotting and linear models
To run your code, click run. It will let you know if your code is correct or not, and will offer hints on what to fix if needed. If you are stuck, you can see the solution by clicking Solution.
Exercise 1: Using mutate()
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImRmIDwtIGRhdGEuZnJhbWUodGljPXJlcChcIldNVFwiLDE5NCksXG4gICAgICAgICAgICAgICAgIGZ5ZWFycT1jKDE5NzAsMTk3MCwxOTcwLDE5NzAsMTk3MSwxOTcxLDE5NzEsMTk3MSwxOTcyLDE5NzIsMTk3MiwxOTcyLDE5NzMsMTk3MywxOTczLDE5NzMsMTk3NCwxOTc0LDE5NzQsMTk3NCwxOTc1LDE5NzUsMTk3NSwxOTc1LDE5NzYsMTk3NiwxOTc2LDE5NzYsMTk3NywxOTc3LDE5NzcsMTk3NywxOTc4LDE5NzgsMTk3OCwxOTc4LDE5NzksMTk3OSwxOTc5LDE5NzksMTk4MCwxOTgwLDE5ODAsMTk4MCwxOTgxLDE5ODEsMTk4MSwxOTgxLDE5ODIsMTk4MiwxOTgyLDE5ODIsMTk4MywxOTgzLDE5ODMsMTk4MywxOTg0LDE5ODQsMTk4NCwxOTg0LDE5ODUsMTk4NSwxOTg1LDE5ODUsMTk4NiwxOTg2LDE5ODYsMTk4NiwxOTg3LDE5ODcsMTk4NywxOTg3LDE5ODgsMTk4OCwxOTg4LDE5ODgsMTk4OSwxOTg5LDE5ODksMTk4OSwxOTkwLDE5OTAsMTk5MCwxOTkwLDE5OTEsMTk5MSwxOTkxLDE5OTEsMTk5MiwxOTkyLDE5OTIsMTk5MiwxOTkzLDE5OTMsMTk5MywxOTkzLDE5OTQsMTk5NCwxOTk0LDE5OTQsMTk5NSwxOTk1LDE5OTUsMTk5NSwxOTk2LDE5OTYsMTk5NiwxOTk2LDE5OTcsMTk5NywxOTk3LDE5OTcsMTk5OCwxOTk4LDE5OTgsMTk5OCwxOTk5LDE5OTksMTk5OSwxOTk5LDIwMDAsMjAwMCwyMDAwLDIwMDAsMj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bigncGFja2FnZScsIG5vdF9jYWxsZWRfbXNnPScnLGluY29ycmVjdF9tc2c9JycpXG4jICAgICAtIHRlc3RfaWZfZWxzZSgpIC0tIGNoZWNraW5nIGlmIHN0YXRlbWVudHNcbiMgICAgIC0gdGVzdF9leHByZXNzaW9uX2Vycm9yKCkgLS0gY2FuIGNoZWNrIGlmIGZ1bmN0aW9ucyBhcmUgcHJvcGVybHkgZGVmaW5lZFxuIyAgICAgLSB0ZXN0X29wZXJhdG9yKCdvcGVyYXRvcicsKSwgbm90X2NhbGxlZF9tc2c9JycsaW5jb3JyZWN0X21zZz0nJylcbiMgICAgIC0gdGVzdF9mdW5jdGlvbl9kZWZpbml0aW9uKCkgLS0gcmlnb3JvdXNseSBjaGVjayBkZWZpbmVkIGZ1bmN0aW9uXG4jICAgICAtIHRlc3RfZGF0YV9mcmFtZSgpIC0tIGNoZWNrIGlmIGRhdGFmcmFtZSBbY29sdW1uc10gYXJlIGVxdWl2YWxlbnRcbiMgICAgIC0gdGVzdF9mdW5jdGlvbl9yZXN1bHQsIHRlc3RfZXhwcmVzc2lvbl9yZXN1bHQifQ==
Exercise 3: Using ggplot()
Note: it appears that Datacamp-light can’t test plot accuracy at the time of writing this. As such, please manually check the solution once you think you know the answer, or if you get stuck.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpICMgbG9hZHMgZHBseXIgZm9yIGRhdGEgbWFuaXB1bGF0aW9uXG5kZiA8LSBkYXRhLmZyYW1lKHRpYz1yZXAoXCJXTVRcIiwxOTQpLFxuICAgICAgICAgICAgICAgICBmeWVhcnE9YygxOTcwLDE5NzAsMTk3MCwxOTcwLDE5NzEsMTk3MSwxOTcxLDE5NzEsMTk3MiwxOTcyLDE5NzIsMTk3MiwxOTczLDE5NzMsMTk3MywxOTczLDE5NzQsMTk3NCwxOTc0LDE5NzQsMTk3NSwxOTc1LDE5NzUsMTk3NSwxOTc2LDE5NzYsMTk3N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BkZWZpbmVkIGZ1bmN0aW9uXG4jICAgICAtIHRlc3RfZGF0YV9mcmFtZSgpIC0tIGNoZWNrIGlmIGRhdGFmcmFtZSBbY29sdW1uc10gYXJlIGVxdWl2YWxlbnRcbiMgICAgIC0gdGVzdF9mdW5jdGlvbl9yZXN1bHQsIHRlc3RfZXhwcmVzc2lvbl9yZXN1bHQifQ==
Exercise 4: A better linear model
Note: it appears that Datacamp-light can’t test plot accuracy at the time of writing this. As such, please manually check the solution once you think you know the answer, or if you get stuck.
Reminder: interactions in a linear model can be done fully using * or partially using :.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpICMgbG9hZHMgZHBseXIgZm9yIGRhdGEgbWFuaXB1bGF0aW9uXG5kZiA8LSBkYXRhLmZyYW1lKHRpYz1yZXAoXCJXTVRcIiwxOTQpLFxuICAgICAgICAgICAgICAgICBmeWVhcnE9YygxOTcwLDE5NzAsMTk3MCwxOTcwLDE5NzEsMTk3MSwxOTcxLDE5NzEsMTk3MiwxOTcyLDE5NzIsMTk3MiwxOTczLDE5NzMsMTk3MywxOTczLDE5NzQsMTk3NCwxOTc0LDE5NzQsMTk3NSwxOTc1LDE5NzUsMTk3NSwxOTc2LDE5NzYsMTk3NiwxOTc2LDE5NzcsMTk3NywxOTc3LDE5NzcsMTk3OCwxOTc4LDE5NzgsMTk3OCwxOTc5LDE5NzksMTk3OSwxOTc5LDE5ODAsMTk4MCwxOTgwLDE5ODAsMTk4MSwxOTgxLDE5ODEsMTk4MSwxOTgyLDE5ODIsMTk4MiwxOTgyLDE5ODMsMTk4MywxOTgzLDE5ODMsMTk4NCwxOTg0LDE5ODQsMTk4NCwxOTg1LDE5ODUsMTk4NSwxOTg1LDE5ODYsMTk4NiwxOTg2LDE5ODYsMTk4NywxOTg3LDE5ODcsMTk4NywxOTg4LDE5ODgsMTk4OCwxOTg4LDE5ODksMTk4OSwxOTg5LDE5ODksMTk5MCwxOTkw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yhcIkF3ZXNvbWUhXCIpXG5cbiMgT3RoZXIgZnVuY3Rpb25zIHRvIG5vdGU6XG4jICAgICAtIHRlc3Rfb3IoYSxiKSAtLSBjaGVja3MgaWYgZWl0aGVyIHRlc3QgYSBvciB0ZXN0IGIgcGFzc1xuIyAgICAgLSB0ZXN0X2dncGxvdCgpIC0tIGNhbiBjaGVjayBpZiBwbG90cyBhcmUgY29ycmVjdFxuIyAgICAgLSB0ZXN0X2Z1bmN0aW9uKCkgLS0gY2FuIGFsc28gY2hlY2sgaW5jbHVkZWQgcGFyYW1ldGVyc1xuIyAgICAgLSB0ZXN0X2xvb3AoKSAtLSBjaGVja2luZyBmb3IgYW5kIHdoaWxlIGxvb3BzXG4jICAgICAtIHRlc3RfbGlicmFyeV9mdW5jdGlvbigncGFja2FnZScsIG5vdF9jYWxsZWRfbXNnPScnLGluY29ycmVjdF9tc2c9JycpXG4jICAgICAtIHRlc3RfaWZfZWxzZSgpIC0tIGNoZWNraW5nIGlmIHN0YXRlbWVudHNcbiMgICAgIC0gdGVzdF9leHByZXNzaW9uX2Vycm9yKCkgLS0gY2FuIGNoZWNrIGlmIGZ1bmN0aW9ucyBhcmUgcHJvcGVybHkgZGVmaW5lZFxuIyAgICAgLSB0ZXN0X29wZXJhdG9yKCdvcGVyYXRvcicsKSwgbm90X2NhbGxlZF9tc2c9JycsaW5jb3JyZWN0X21zZz0nJylcbiMgICAgIC0gdGVzdF9mdW5jdGlvbl9kZWZpbml0aW9uKCkgLS0gcmlnb3JvdXNseSBjaGVjayBkZWZpbmVkIGZ1bmN0aW9uXG4jICAgICAtIHRlc3RfZGF0YV9mcmFtZSgpIC0tIGNoZWNrIGlmIGRhdGFmcmFtZSBbY29sdW1uc10gYXJlIGVxdWl2YWxlbnRcbiMgICAgIC0gdGVzdF9mdW5jdGlvbl9yZXN1bHQsIHRlc3RfZXhwcmVzc2lvbl9yZXN1bHQifQ==
Exercise 5: Plotting the better linear model
Note: it appears that Datacamp-light can’t test plot accuracy at the time of writing this. As such, please manually check the solution once you think you know the answer, or if you get stuck.
Notice how this code is identical to exercise 3, except with the different model name.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpICMgbG9hZHMgZHBseXIgZm9yIGRhdGEgbWFuaXB1bGF0aW9uXG5kZiA8LSBkYXRhLmZyYW1lKHRpYz1yZXAoXCJXTVRcIiwxOTQpLFxuICAgICAgICAgICAgICAgICBmeWVhcnE9YygxOTcwLDE5NzAsMTk3MCwxOTcwLDE5NzEsMTk3MSwxOTcxLDE5NzEsMTk3MiwxOTcyLDE5NzIsMTk3MiwxOTczLDE5NzMsMTk3MywxOTczLDE5NzQsMTk3NCwxOTc0LDE5NzQsMTk3NSwxOTc1LDE5NzUsMTk3NSwxOTc2LDE5NzYsMTk3NiwxOTc2LDE5NzcsMTk3NywxOTc3LDE5NzcsMTk3OCwxOTc4LDE5NzgsMTk3OCwxOTc5LDE5NzksMTk3OSwxOTc5LDE5ODAsMTk4MCwxOTgwLDE5ODAsMTk4MSwxOTgxLDE5ODEsMTk4MSwxOTgyLDE5ODIsMTk4MiwxOTgyLDE5ODMsMTk4MywxOTgzLDE5ODMsMTk4NCwxOTg0LDE5ODQsMTk4NCwxOTg1LDE5ODUsMTk4NSwxOTg1LDE5ODYsMTk4NiwxOTg2LDE5ODYsMTk4NywxOTg3LDE5ODcsMTk4NywxOTg4LDE5ODgsMTk4OCwxOTg4LDE5ODksMTk4OSwxOTg5LDE5ODksMTk5MCwxOTkwLDE5OTAsMTk5MCwxOTkxLDE5OTEsMTk5MSwxOTkxLDE5OTIsMTk5MiwxOTkyLDE5OTIsMTk5MywxOTkzLDE5OTMsMTk5MywxOTk0LDE5OTQsMTk5NCwxOTk0LDE5OTUsMTk5NSwxOTk1LDE5OTUsMTk5NiwxOTk2LDE5OTYsMTk5NiwxOTk3LDE5OTcsMTk5NywxOTk3LDE5OTgsMTk5OCwxOTk4LDE5OTgsMTk5OSwx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gZWl0aGVyIHRlc3QgYSBvciB0ZXN0IGIgcGFzc1xuIyAgICAgLSB0ZXN0X2dncGxvdCgpIC0tIGNhbiBjaGVjayBpZiBwbG90cyBhcmUgY29ycmVjdFxuIyAgICAgLSB0ZXN0X2Z1bmN0aW9uKCkgLS0gY2FuIGFsc28gY2hlY2sgaW5jbHVkZWQgcGFyYW1ldGVyc1xuIyAgICAgLSB0ZXN0X2xvb3AoKSAtLSBjaGVja2luZyBmb3IgYW5kIHdoaWxlIGxvb3BzXG4jICAgICAtIHRlc3RfbGlicmFyeV9mdW5jdGlvbigncGFja2FnZScsIG5vdF9jYWxsZWRfbXNnPScnLGluY29ycmVjdF9tc2c9JycpXG4jICAgICAtIHRlc3RfaWZfZWxzZSgpIC0tIGNoZWNraW5nIGlmIHN0YXRlbWVudHNcbiMgICAgIC0gdGVzdF9leHByZXNzaW9uX2Vycm9yKCkgLS0gY2FuIGNoZWNrIGlmIGZ1bmN0aW9ucyBhcmUgcHJvcGVybHkgZGVmaW5lZFxuIyAgICAgLSB0ZXN0X29wZXJhdG9yKCdvcGVyYXRvcicsKSwgbm90X2NhbGxlZF9tc2c9JycsaW5jb3JyZWN0X21zZz0nJylcbiMgICAgIC0gdGVzdF9mdW5jdGlvbl9kZWZpbml0aW9uKCkgLS0gcmlnb3JvdXNseSBjaGVjayBkZWZpbmVkIGZ1bmN0aW9uXG4jICAgICAtIHRlc3RfZGF0YV9mcmFtZSgpIC0tIGNoZWNrIGlmIGRhdGFmcmFtZSBbY29sdW1uc10gYXJlIGVxdWl2YWxlbnRcbiMgICAgIC0gdGVzdF9mdW5jdGlvbl9yZXN1bHQsIHRlc3RfZXhwcmVzc2lvbl9yZXN1bHQifQ==
Exercise 6: Comparing the models with a line plot
Note: it appears that Datacamp-light can’t test plot accuracy at the time of writing this. As such, please manually check the solution once you think you know the answer, or if you get stuck.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpIC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