-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDevelopmentFIile.R
More file actions
44 lines (31 loc) · 845 Bytes
/
DevelopmentFIile.R
File metadata and controls
44 lines (31 loc) · 845 Bytes
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
setwd("~/GitHub/2016Midterm")
#package.skeleton("integrateIt")
rm(list=ls())
library(devtools)
library(roxygen2)
current.code <- as.package("integrateIt")
load_all(current.code)
document(current.code)
# an example
tryx<-seq(-5, 4.99, by=.95)
length(tryx)
tryy<-dnorm(tryx)
exampSimp<-integrateIt(tryx, tryy, -5, 5, rule="Simp")
exampTrap<-integrateIt(tryx, tryy, -5, 5, rule="Trap")
print(exampSimp)
plot(exampSimp)
print(exampTrap)
plot(exampTrap)
help(integrateIt)
help(Trapezoid)
help(Simpson)
# testing the validity checks
tryx<-seq(-5, 4.99, by=.9)
length(tryx)
exampSimp<-integrateIt(tryx, tryy, -5, 5, rule="Simp")
exampTrap<-integrateIt(tryx, tryy, -5, 5, rule="Trap")
tryy[1]<-NA
exampTrap<-integrateIt(tryx, tryy, -5, 5, rule="Trap")
tryy<-dnorm(tryx)
tryy<-tryy[-1]
exampTrap<-integrateIt(tryx, tryy, -5, 5, rule="Trap")