/
9plotThresholdsAll.Rmd
142 lines (117 loc) · 5.8 KB
/
9plotThresholdsAll.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
---
title: Average thresholds
output:
html_document:
toc: true
toc_depth: 5
---
```{r global, echo=FALSE,message=FALSE,results='hide'}
source('libsAndMore.R')
opts_chunk$set(echo=FALSE, fig.align='center', fig.width = 10, fig.height = 5)
```
```{r input, echo=FALSE, message=FALSE, results='hide'}
fitsAll <- read.table('logdata/fitsAll.txt')
fitsExtrAll <- read.table('logdata/fitsExtrAll.txt')
fitsExtrAllFreq <- read.table('logdata/fitsExtrAllFreq.txt')
fitsExtrAllTf <- read.table('logdata/fitsExtrAllTf.txt')
fitsBootExtrDifAll <- read.table('logdata/fitsBootExtrDifAll.txt')
fitsBootExtrDif2All <- read.table('logdata/fitsBootExtrDif2All.txt')
fitsBootExtrDifNumberAll <- read.table('logdata/fitsBootExtrDifNumberAll.txt')
fitsBootExtrDifNumber2All <- read.table('logdata/fitsBootExtrDifNumber2All.txt')
fitsBootExtrDifFreqAll <- read.table('logdata/fitsBootExtrDifFreqAll.txt')
fitsBootExtrDif2FreqAll <- read.table('logdata/fitsBootExtrDif2FreqAll.txt')
fitsBootExtrDifNumberFreqAll <-
read.table('logdata/fitsBootExtrDifNumberFreqAll.txt')
fitsBootExtrDifNumber2FreqAll <-
read.table('logdata/fitsBootExtrDifNumber2FreqAll.txt')
fitsBootExtrDifTfAll <-
read.table('logdata/fitsBootExtrDifTfAll.txt')
fitsBootExtrDif2TfAll <-
read.table('logdata/fitsBootExtrDif2TfAll.txt')
fitsBootExtrDifNumberTfAll <-
read.table('logdata/fitsBootExtrDifNumberTfAll.txt')
fitsBootExtrDifNumber2TfAll <-
read.table('logdata/fitsBootExtrDifNumber2TfAll.txt')
```
#### For number and radius
```{r thresholds, message=FALSE, warning=FALSE}
plotThresholdsSpeedAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold2(., NULL, NULL, x = 'speed',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'numberradius',p))
plotThresholdsFreqAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold2(., NULL, NULL,x = 'freq',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'numberradius',p))
plotThresholdsTfAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold2(., NULL, NULL, x = 'tf',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'numberradius',p))
plotThresholdsAngleAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold2(., NULL, NULL, x = 'angle',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'numberradius',p))
multiplot(c(plotThresholdsSpeedAll$plot,
plotThresholdsFreqAll$plot,
plotThresholdsTfAll$plot),cols=3)
```
#### For radius
```{r thresholdsRadius, message=FALSE, warning=FALSE}
plotThresholdsSpeedRadiusAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold(.,
merge(filter(fitsExtrAll, radius==2), fitsBootExtrDifAll),
merge(filter(fitsExtrAll, radius==2), fitsBootExtrDif2All),
x = 'speed',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'radius',p))
plotThresholdsFreqRadiusAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold(.,
merge(filter(fitsExtrAllFreq, radius==4), fitsBootExtrDifFreqAll),
merge(filter(fitsExtrAllFreq, radius==4), fitsBootExtrDif2FreqAll),
x = 'freq',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'radius',p))
plotThresholdsTfRadiusAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold2(., fitsBootExtrDifTfAll,
fitsBootExtrDif2TfAll,
x = 'tf',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'radius',p))
plotThresholdsAngleRadiusAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold2(., NULL, NULL, x = 'angle',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'radius',p))
multiplot(c(plotThresholdsSpeedRadiusAll$plot,
plotThresholdsFreqRadiusAll$plot,
plotThresholdsTfRadiusAll$plot),cols=3)
```
#### For number
```{r thresholdsNumber, message=FALSE, warning=FALSE}
plotThresholdsSpeedNumberAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold2(., fitsBootExtrDifNumberAll,
fitsBootExtrDifNumber2All,
x = 'speed',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'number',p))
plotThresholdsFreqNumberAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold(.,
merge(filter(fitsExtrAllFreq, number==2), fitsBootExtrDifNumberFreqAll),
merge(filter(fitsExtrAllFreq, number==2), fitsBootExtrDifNumber2FreqAll),
x = 'freq',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'number',p))
plotThresholdsTfNumberAll <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold(.,
merge(filter(fitsExtrAllTf, number==1), fitsBootExtrDifNumberTfAll),
merge(filter(fitsExtrAllTf, number==1), fitsBootExtrDifNumber2TfAll),
x = 'tf',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'number',p))
plotThresholdsAngleNumber <- fitsAll %>% group_by(subject) %>%
do(plot = plotThreshold2(., NULL, NULL, x = 'angle',
y = 'pse', ymin = 'psemin', ymax = 'psemax',
cond = 'number',p))
multiplot(c(plotThresholdsSpeedNumberAll$plot,
plotThresholdsFreqNumberAll$plot,
plotThresholdsTfNumberAll$plot),cols=3)
```