-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctionsMSP.R
More file actions
50 lines (31 loc) · 1.42 KB
/
FunctionsMSP.R
File metadata and controls
50 lines (31 loc) · 1.42 KB
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
## functions page for 'MultiSpPrac.Rmd'
# function to plot distributions
plot.map <- function(col,df) {
r <- raster(nrow=1177,ncol=1342,xmn=1, xmx=1342, ymn=1, ymx=1177)
df <- df[order(df$uniqueID),]
r[] <- df[,col]
plot(r)
}
plotmeansCI <- function(m,ylim) {
mc <- summary(m)$coef[,1]
sdc <- 1.96*summary(m)$coef[,2]
plot(1:length(mc),mc,
pch=19, col=c('cadetblue4'),xaxt='n',xlab="", ylab="Mean Parameter Estimates",cex=1.4,cex.lab=1.4,las=1,ylim=ylim)
arrows(1:length(mc), mc-sdc, 1:length(mc), mc+sdc, length=0.05, angle=90, code=3, col=c('cadetblue4'))
abline(h=0,col='grey85')
axis(1,at=c(1:length(mc)),labels=names(mc))
}
plotmeansCredInt <- function(mc,lo,up,ylim) {
plot(1:length(mc),mc,
pch=19, col=c('cadetblue4'),xaxt='n',xlab="", ylab="Mean Parameter Estimates",cex=1.4,cex.lab=1.4,las=1,ylim=ylim)
arrows(1:length(mc), lo, 1:length(mc), up, length=0.05, angle=90, code=3, col=c('cadetblue4'))
abline(h=0,col='grey85')
axis(1,at=c(1:length(mc)),labels=c('int','b4','b12','foot'))
}
plotmeansCredIntRho <- function(mc,lo,up,ylim) {
plot(1:length(mc),mc,
pch=19, col=c('cadetblue4'),xaxt='n',xlab="", ylab="Mean Parameter Estimates",cex=1.4,cex.lab=1.4,las=1,ylim=ylim)
arrows(1:length(mc), lo, 1:length(mc), up, length=0.05, angle=90, code=3, col=c('cadetblue4'))
abline(h=0,col='grey85')
axis(1,at=c(1:length(mc)),labels=c('M295','M61','M94'))
}