-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpop_eco.Rmd
148 lines (106 loc) · 2.95 KB
/
pop_eco.Rmd
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
Population Ecology
========================================================
```{r setglobalopts, echo = F}
opts_chunk$set(comment = NA, fig.width=7, fig.height=6)
```
```{r simpleEQ}
N.t = 30
R = 1.16
N.t1 <- N.t * R
N.t1
```
We can use this equation for multiple years and plot the result:
```{r ExpGrowth}
N <- c()
for(i in 1:10){
N[i] <- N.t * R ^ i
}
plot(N)
```
## Exercise Examples
1.1 Blue Whale Recovery
```{r}
N.1963 <- 10000
N.target <- 50000
R <- 1.10
t <- log(50000/10000) / log(R)
t
R <- 1.02
t <- log(50000/10000) / log(R)
t
```
1.2 Human Population (1800 - 1995)
```{r}
humans <- data.frame(Year = c(1800, 1850, 1870, 1890, 1910, 1930, 1950, 1970, 1975, 1980, 1985, 1990, 1995))
humans <- cbind(humans, Population = c(0.91, 1.13, 1.30, 1.49, 1.70, 2.02, 2.51, 3.62, 3.97, 4.41, 4.84, 5.29, 5.75))
Time.Interval <- c()
Time.Interval[1] <- NA
for (i in 2:length(humans$Year)){
Time.Interval[i] <- humans$Year[i] - humans$Year[i-1]
}
Prev.Population <- humans$Population[1:(length(humans$Population)-1)]
Growth.Rate <- humans$Population[2:length(humans$Population)] / Prev.Population
Annual.Growth.Rate <- Growth.Rate ^ (1 / Time.Interval[2:length(Time.Interval)])
Table_1.3 <- cbind(humans, Time.Interval,
Prev.Population = c(NA, Prev.Population),
Growth.Rate = c(NA, Growth.Rate),
Annual.Growth.Rate = c(NA, Annual.Growth.Rate))
Table_1.3
```
```{r echo = FALSE, include = F}
require(ggplot2)
```
Plot using Growth Rate
```{r}
qplot(x = Table_1.3$Year[2:13], y = Table_1.3$Growth.Rate[2:13],
xlab = "Year", ylab = "Growth Rate")
```
Plot using the Annual Growth Rate
```{r}
qplot(x = Table_1.3$Year[2:13], y = Table_1.3$Annual.Growth.Rate[2:13],
xlab = "Year", ylab = "Annual Growth Rate")
```
Compare the change in annual growth rate with the absolute increase in number of people
```{r}
Table_1.4 <- data.frame(Year = c(1975, 1985, 1995), Population.Size = c(3.97, 4.84, 5.75),
Annual.Growth.Rate = c(1.018630, 1.018782, 1.016816))
Number.Added <- Table_1.4$Population.Size * (Table_1.4$Annual.Growth.Rate - 1)
Table_1.4 <- cbind(Table_1.4, Number.Added)
Table_1.4
```
Calculate (based on the number added in 1995) the number added:
* per day:
```{r}
per.day <- Table_1.4$Number.Added[3] / 365
per.day
```
* per hour:
```{r}
per.hour <- per.day / 24
per.hour
```
* per minute:
```{r}
per.minute = per.hour / 60
per.minute
```
1.3 Human Population (1995 - 2035)
```{r}
Table_1.5 <- data.frame(Year = c(1995, 2005, 2015, 2025, 2035))
fec <- 0.0273
R <- 1.016816
s <- R - fec
change10yr <- (R - 1) / 4
R05 <- R - change10yr
R15 <- R05 - change10yr
R25 <- R15 - change10yr
Rs <- c(R, R05, R15, R25, 1)
fecs <- Rs - s
Rs10 <- Rs ^ 10
Population <- 5.75
for(i in 2:5){
Population[i] <- Population[i-1] * Rs10[i-1]
}
Table_1.5 <- cbind(Table_1.5, Fecundity = fecs, R = Rs, R_10_yr = Rs10, Population = Population)
Table_1.5
```