Skip to content

Commit e375998

Browse files
committed
Updates
1 parent df49ec2 commit e375998

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Practice_Assignment.pdf

1.02 KB
Binary file not shown.

practice_assignment.rmd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,8 @@ weightmedian("diet_data", 4)
250250
weightmedian("diet_data", 17)
251251
```
252252

253-
Hopefully, this has given you some practice applying the basic concepts from weeks 1 and 2. If you can work your way through this example, you should have all of the tools needed to complete part 1 of assignment 1. Parts 2 and 3 are really just expanding on the same basic concepts, potentially adding in some ideas like cbinds and if-else.
253+
Hopefully, this has given you some practice applying the basic concepts from weeks 1 and 2. If you can work your way through this example, you should have all of the tools needed to complete part 1 of assignment 1. Parts 2 and 3 are really just expanding on the same basic concepts, potentially adding in some ideas like cbinds and if-else.
254+
255+
One last quick note: The approach I'm showing above for building the data frame is submoptimal. It works, but generally speaking, you don't want to build data frames or vectors by copying and re-copying them inside of a loop. If you've got a lot of data it can become very, very slow. However, this tutorial is meant to provide an introduction to these concepts, and you can use this approach successfully for programming assignments 1 and 3.
256+
257+
If you're interested in learning the better approach, check out Hadley Wickam's excellent material on functionals within R: http://adv-r.had.co.nz/Functionals.html. But if you're new to both programming and R, I would skip it for now as it will just confuse you. Come back and revisit it once you are able to write working functions using the approach above.

0 commit comments

Comments
 (0)