Skip to content

Commit

Permalink
Merge pull request #890 from andrewmarx/master
Browse files Browse the repository at this point in the history
Week 3 assignment and output fixes
  • Loading branch information
ethanwhite committed Sep 15, 2020
2 parents 13d0179 + 941781d commit 1eb3a9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 57 deletions.
2 changes: 1 addition & 1 deletion exercises/Portal-data-manip-pipes-R.md
Expand Up @@ -11,7 +11,7 @@ and load it into R using `read.csv()`.

Use pipes (`%>%`) to combine the following operations to manipulate the data.

1. Use `mutate()`, `select()`, and `filter` with `is.na()` to create a new data frame with
1. Use `mutate()`, `select()`, and `filter()` with `is.na()` to create a new data frame with
the `year`, `species_id`, and weight **in kilograms** of each individual,
with no null weights.
2. Use the `filter()` and `select()` to get the `year`, `month`, `day`, and
Expand Down
8 changes: 4 additions & 4 deletions exercises/Vectors-bird-banding-R.md
Expand Up @@ -8,9 +8,9 @@ language: R
The number of birds banded at a series of sampling sites has been counted by
your field crew and entered into the following vector. Counts are entered in
order and sites are numbered starting at one. Cut and paste the vector into your
assignment and then answer the following questions by printing them to the
screen. Some R functions that will come in handy include `length()`, `max()`,
`min()`, `sum()`, and `mean()`.
assignment and then answer the following questions by using code and printing the
result to the screen. Some R functions that will come in handy include `length()`,
`max()`, `min()`, `sum()`, and `mean()`.

```
number_of_birds <- c(28, 32, 1, 0, 10, 22, 30, 19, 145, 27,
Expand All @@ -30,4 +30,4 @@ number_of_birds <- c(28, 32, 1, 0, 10, 22, 30, 19, 145, 27,
last site automatically in some way, not by manually entering its position.
Do you know a function that will give you the position of the last value?
(since positions start at 1 the position of the last value in a vector is the
same as its length).
same as its length).
52 changes: 0 additions & 52 deletions solutions/Portal-data-manip-R.txt
Expand Up @@ -92,55 +92,3 @@
25 14488 5 15 1988 3 SH F 27 108
...
[ reached 'max' / getOption("max.print") -- omitted 36 rows ]

> # 4.

# A tibble: 49 x 2
species_id count
<fct> <int>
1 "" 763
2 AB 303
3 AH 437
4 AS 2
5 BA 46
6 CB 50
7 CM 13
8 CQ 16
9 CS 1
10 CT 1
# … with 39 more rows

> # 5.

# A tibble: 535 x 3
# Groups: species_id [49]
species_id year count
<fct> <int> <int>
1 "" 1977 16
2 "" 1978 56
3 "" 1979 61
4 "" 1980 40
5 "" 1981 55
6 "" 1982 14
7 "" 1983 21
8 "" 1984 30
9 "" 1985 22
10 "" 1986 20
# … with 525 more rows

> # 6.

# A tibble: 26 x 2
year mean_mass
<int> <dbl>
1 1977 42.7
2 1978 45
3 1979 45.9
4 1980 48.1
5 1981 49.1
6 1982 47.9
7 1983 47.2
8 1984 48.4
9 1985 48.0
10 1986 49.4
# … with 16 more rows

0 comments on commit 1eb3a9f

Please sign in to comment.