-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
512 lines (512 loc) · 23.7 KB
/
.Rhistory
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
show(p.binding.s)
p.binding.s <- ggplot(b, aes(x=mutations, y=binding.selected)) + stat_smooth(se=F, method = "lm", formula = y ~ poly(x, 2)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(-25, 5))
show(p.binding.s)
p.binding.u <- ggplot(b, aes(x=mutations, y=binding.unselected)) + stat_smooth(se=F, method = "lm", formula = y ~ poly(x, 2)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(-25, 5))
show(p.binding.s)
show(p.binding.u)
p.binding.u <- ggplot(b, aes(x=mutations, y=binding.unselected)) + stat_smooth(se=F, method = "lm", formula = y ~ poly(x, 3)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(-25, 5))
show(p.binding.u)
p.binding.u <- ggplot(b, aes(x=mutations, y=binding.unselected)) + stat_smooth(se=F, method = "loess") + geom_point(alpha=0.5) + scale_y_continuous(limits=c(-25, 5))
show(p.binding.u)
p.binding.u <- ggplot(b, aes(x=mutations, y=binding.unselected)) + stat_smooth(se=F, method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(-25, 5))
show(p.binding.u)
p.binding.u <- ggplot(b, aes(x=mutations, y=binding.unselected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(-25, 5))
show(p.binding.u)
p.stability.u <- ggplot(b, aes(x=mutations, y=stability.unselected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(-25, 5))
show(p.stability.u)
head(b)
p.stability.u <- ggplot(b, aes(x=mutations, y=stability.unselected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(-100, 100))
head(b)
show(p.stability.u)
p.stability.s <- ggplot(b, aes(x=mutations, y=stability.selected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(-100, 100))
show(p.stability.s)
p.stability.s <- ggplot(b, aes(x=mutations, y=stability.selected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(20, 50))
show(p.stability.s)
p.stability.s <- ggplot(b, aes(x=mutations, y=stability.selected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(25, 35))
show(p.stability.s)
p.stability.u <- ggplot(b, aes(x=mutations, y=stability.unselected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(25, 35))
show(p.stability.s)
show(p.stability.u)
p.stability.u <- ggplot(b, aes(x=mutations, y=stability.unselected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(15, 45))
show(p.stability.u)
p.stability.u <- ggplot(b, aes(x=mutations, y=stability.unselected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(25, 40))
show(p.stability.u)
p.stability.u <- ggplot(b, aes(x=mutations, y=stability.unselected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(20, 40))
show(p.stability.u)
p.stability.s <- ggplot(b, aes(x=mutations, y=stability.selected)) + stat_smooth(method = "lm", formula = y ~ poly(x, 1)) + geom_point(alpha=0.5) + scale_y_continuous(limits=c(20, 40))
show(p.stability.s)
source('~/Google Drive/Data/influenza_pH1N1_timecourse/NA/dNdS/distances/calc_correlations.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
install.packages('dplyr')
source('~/Desktop/plot_host_trop.R')
by.chain <- group_by(df, chain.id)
by.chain
summarise(by.chain)
by.chain
df %>% group_by(chain.id, time)
df %>% group_by(chain.id, time) %>% summarise()
df %>% group_by(chain.id, time) %>% summarise(ttest = t.test(binding))
df %>% group_by(chain.id, time) %>% do(ttest = t.test(binding))
df %>% group_by(chain.id, time) %>% do(ttest = t.test(.binding))
df %>% group_by(chain.id, time) %>% do(ttest = t.test(.$binding))
df %>% group_by(chain.id, time) %>% do(ttest = t.test(.$binding)$p.value)
df %>% group_by(chain.id, time) %>% do(ttest = t.test(.$binding)$p)
t.test(c(1,2,3,4,5), c(3,4,5,5,6))
t.test(c(1,2,3,4,5), c(3,4,5,5,6))$p.value
df %>% group_by(chain.id, time) %>% do(ttest = t.test(.$binding)$p.value)
df %>% group_by(chain.id, time) %>% summarise(ttest = t.test(binding)$p.value)
tests = df %>% group_by(chain.id, time) %>% summarise(ttest = t.test(binding)$p.value)
test
tests
tests$ttest
tests = df %>% group_by(chain.id) %>% group_by(time) %>% summarise(ttest = t.test(binding)$p.value)
tests$ttest
t.test(c(1,2,3,4,5), c(3,4,5,5,6))$p.value
t.test(c(1,2,3,4,5), c(3,4,5,5,6))$diff
t.test(c(1,2,3,4,5), c(3,4,5,5,6))$difference
at.test(c(1,2,3,4,5), c(3,4,5,5,6))
a<-t.test(c(1,2,3,4,5), c(3,4,5,5,6))
a$statistic
a$estimate
a$parameter
a$estimate
a$statistic
source('~/Desktop/plot_host_trop.R')
tests
tests$ttest
tests
source('~/Desktop/plot_host_trop.R')
tests
print(tests)
tests$chain.id
tests$time
tests$ttest
source('~/Desktop/plot_host_trop.R')
tests
tests$time
source('~/Desktop/plot_host_trop.R')
tests
tests$mean
source('~/Desktop/plot_host_trop.R')
tests$mean
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
tests = df %>% group_by(chain.id, time) %>% summarise_each(ttest = funs(t.test(.[chain.id == 'selected'], .[chain.id == 'unselected'])$p.value))
tests = df %>% group_by(chain.id, time) %>% summarise_each(funs(t.test(.[chain.id == 'selected'], .[chain.id == 'unselected'])$p.value))
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
df
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
test
test
tests
source('~/Desktop/plot_host_trop.R')
df[is.na(df)]
source('~/Desktop/plot_host_trop.R')
df
df$binding
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
tests
source('~/Desktop/plot_host_trop.R')
tests$ttest
source('~/Desktop/plot_host_trop.R')
plot(1:length(tests$ttest), ttest, ylim=c(0,1))
plot(1:length(tests$ttest), tests$ttest, ylim=c(0,1))
source('~/Desktop/plot_host_trop.R')
plot(1:length(tests$ttest), tests$ttest, ylim=c(0,1))
df %>% group_by(time)
a <- df %>% group_by(time)
a$binding
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
df$binding[time == 1000 & chain.id == 'selected']
df$binding[time == 1000 & chain.id == 'selected']
df
df$binding[df$time == 1000 & df$chain.id == 'selected']
t.test(df$binding[df$time == 1000 & df$chain.id == 'selected'], df$binding[df$time == 1000 & df$chain.id == 'unselected'])
tests$ttest[1000]
tests$ttest[1001]
t.test(df$binding[df$time == 1001 & df$chain.id == 'selected'], df$binding[df$time == 1001 & df$chain.id == 'unselected'])
t.test(df$binding[df$time == 1001 & df$chain.id == 'selected'])
t.test(df$binding[df$time == 1001 & df$chain.id == 'unselected'])
t.test(df$binding[df$time == 1001 & df$chain.id == 'selected'])
t.test(df$binding[df$time == 1001 & df$chain.id == 'selected'], df$binding[df$time == 1 & df$chain.id == 'selected'])
t.test(df$binding[df$time == 1001 & df$chain.id == 'unselected'], df$binding[df$time == 1 & df$chain.id == 'unselected'])
source('~/Desktop/plot_host_trop.R')
df$binding[df$chain.id == 'selected']
df$binding[df$chain.id == 'selected'] < 10
df$binding[df$chain.id == 'selected'] > -10
df$id[df$binding[df$chain.id == 'selected'] > -10]
df$binding[df$id==34]
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
plot(1:length(tests$ttest), tests$ttest)
plot(tests$time, tests$ttest)
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
p2 <- ggplot(tests, aes(x=time, y=ttest)) + geom_point() + geom_smooth(method = 'loess')
tests <- df %>% group_by(time) %>% summarise(ttest = t.test(binding[chain.id == 'selected'], binding[chain.id == 'unselected'])$p.value)
p2 <- ggplot(tests, aes(x=time, y=ttest)) + geom_point() + geom_smooth(method = 'loess')
show(p2)
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
tests$ttest
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
p2 <- ggplot(tests, aes(x=time, y=one.sample.one)) + geom_point() + geom_smooth()
show(p2)
p2 <- ggplot(tests, aes(x=time, y=one.sample.both)) + geom_point() + geom_smooth()
show(p2)
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
rm(list = ls())
setwd('~/Desktop/')
library(ggplot2)
library(cowplot)
library(dplyr)
get.data.selected <- function(where) {
id <- c()
binding.s <- c()
binding.u <- c()
selected.chain <- c()
time <- c()
print(length(list.files(where)))
for(i in list.files(where)) {
tmp.data <- read.table(paste(where, i, sep=''), head=T)
selected.chain <- append(selected.chain, rep(tmp.data$selected_chain[dim(tmp.data)[1]], dim(tmp.data)[1]))
id <- append(id, rep(as.numeric(substr(i, 1, nchar(i) - 4)), dim(tmp.data)[1]))
selected.name <- paste('binding_complex', tmp.data$selected_chain[dim(tmp.data)[1]], sep='')
binding.s <- append(binding.s, tmp.data[[selected.name]])
unselected.name <- paste('binding_complex', 1 - selected.chain[1], sep='')
binding.u <- append(binding.u, tmp.data[[unselected.name]])
time <- append(time, tmp.data$count)
}
tmp.df <- data.frame(time = c(time, time),
id = c(id, id),
chain.id = c(rep('selected', length(id)), rep('unselected', length(id))),
selected.chain = c(selected.chain, selected.chain),
binding = c(binding.s, binding.u))
return(tmp.df[tmp.df$time <= 1000])
}
get.data.notselected <- function(where) {
id <- c()
binding <- c()
selected.chain <- c()
time <- c()
print(length(list.files(where)))
for(i in list.files(where)) {
tmp.data <- read.table(paste(where, i, sep=''), head=T)
binding <- append(binding, c(tmp.data$binding_complex0, tmp.data$binding_complex1))
id <- append(id, rep(as.numeric(substr(i, 1, nchar(i) - 4)), dim(tmp.data)[1]*2))
time <- append(time, c(tmp.data$count, tmp.data$count))
}
tmp.df <- data.frame(time = time,
id = id,
binding = binding)
return(tmp.df[tmp.df$time <= 1000])
}
df.one.r1 <- get.data.selected('~/Desktop/evolved_data/one_r1_data/')
df.one.r10 <- get.data.selected('~/Desktop/evolved_data/one_r10_data/')
df.one.r100 <- get.data.selected('~/Desktop/evolved_data/one_r100_data/')
df.both.r1 <- get.data.notselected('~/Desktop/evolved_data/both_r1_data/')
df.both.r10 <- get.data.notselected('~/Desktop/evolved_data/both_r10_data/')
df.both.r100 <- get.data.notselected('~/Desktop/evolved_data/both_r100_data/')
df.one.r1 <- get.data.selected('~/Desktop/evolved_data/one_r1_data/')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
getwd()
setwd('evolved_data/')
list.files('both_r10_data/')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
tests <- df %>% group_by(time) %>% summarise(two.sample = t.test(binding[id == 'r1'], binding[id == 'r100'])$p.value, one.sample.one = t.test(binding[id == 'r1'])$p.value, one.sample.both = t.test(binding[id == 'r100'])$p.value)
p2 <- ggplot(tests, aes(x=time, y=two.sample)) + geom_point() + geom_smooth(size=1.2, se=T, method='loess') + ylab('P-value') + xlab('Time (mutations attempted)')
show(p2)
show(p1)
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
show(p2)
source('~/Desktop/plot_host_trop.R')
ggsave(p2, file='~/Desktop/p_value_r1.pdf', height = 6, width = 6.5, useDingbats=F)
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
source('~/Desktop/plot_host_trop.R')
getwd)
getwd()
getwd()
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot.R')
r.value.9
r.value.10
r.value.11
r.value.3
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_internal_barplot.R')
r.value.3
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot.R')
r.value.3
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_internal_barplot.R')
r.value.3
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot.R')
r.value.3
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot_slac_all.R')
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot_slac_all.R')
d$SLAC.dN.All
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot_slac_all.R')
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot_slac_internal.R')
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot_slac_internal.R')
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot_slac_tips.R')
r.value.2
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot_slac_internal.R')
r.value.2
source('~/Google Drive/Data/influenza_HA_evolution/figures/rsquared_barplot_slac_all.R')
r.value.2
install.packages('snpMatrix')
library(snpMatrix)
source('~/Desktop/random_sample.R')
source('~/Desktop/random_sample.R')
source('~/Desktop/random_sample.R')
source('~/Desktop/random_sample.R')
source('~/Desktop/random_sample.R')
source('~/Desktop/random_sample.R')
source('~/Desktop/random_sample.R')
AIC(initial.fit.1)
AIC(initial.fit.3)
AIC(initial.fit.4)
BIC(initial.fit.1)
BIC(initial.fit.3)
test <- df
test$Bush.99[test$Bush.99 != '-'] <- 'A'
test$Bush.99
fit <- lm(test$FEL.dN.dS ~ test$Bush.99)
summary(fit)
AIC(fit)
AIC(initial.fit.2)
initial.fit.test <- lm(df$FEL.dN.dS ~ df$RSA.Multimer + I(1/df$distance.to.224.all) + test$Bush.99)
AIC(initial.fit.3)
AIC(initial.fit.test)
BIC(initial.fit.3)
BIC(initial.fit.test)
summary(initial.fit.1)
plot(initial.fit.1)
initial.fit.1$residuals
plot(initial.fit.1$residuals, initial.fit.3$residuals)
plot(initial.fit.1$residuals, initial.fit.3$residuals, ylim=c(-2, 2), xlim=c(-2,2))
abline(0,1)
plot(initial.fit.1$residuals^2, initial.fit.3$residuals^2, ylim=c(-2, 2), xlim=c(-2,2))
abline(0,1)
p <- ggplot(data.frame(x=initial.fit.1$residuals^2, y=initial.fit.3$residuals^2, cats=df$Bush.99), aes(x=x, y=y, col=cats)) + geom_point()
show(p)
p <- ggplot(data.frame(x=initial.fit.1$residuals^2, y=initial.fit.3$residuals^2, cats=df$Bush.99), aes(x=x, y=y, col=cats)) + geom_point(size=4)
show(p)
p <- ggplot(data.frame(x=initial.fit.1$residuals^2, y=initial.fit.3$residuals^2, cats=df$Bush.99), aes(x=x, y=y, col=cats)) + geom_point(size=4) + geom_abline(0,1)
p <- ggplot(data.frame(x=initial.fit.1$residuals^2, y=initial.fit.3$residuals^2, cats=df$Bush.99), aes(x=x, y=y, col=cats)) + geom_point(size=4) + geom_abline(intercept=0, slope=1)
p <- ggplot(data.frame(x=initial.fit.1$residuals^2, y=initial.fit.3$residuals^2, cats=df$Bush.99), aes(x=x, y=y, col=cats)) + geom_point(size=4) + geom_abline(0,1)
p <- ggplot(data.frame(x=initial.fit.1$residuals^2, y=initial.fit.3$residuals^2, cats=df$Bush.99), aes(x=x, y=y, col=cats)) + geom_point(size=4) + geom_abline(intercept=0, slope=1)
show(p)
getwd()
as.character(c(0000000000000000000000000000000000000000000011111011011001010011000100000001001011110011100110101000001100000100000001000110101011111101011010111110001010011111000101011011111111010010001111101110111001010001110011111111000000111110000000101010101110000000000011100100000001011011100000000000001001011000110111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
)
as.character(c("0000000000000000000000000000000000000000000011111011011001010011000100000001001011110011100110101000001100000100000001000110101011111101011010111110001010011111000101011011111111010010001111101110111001010001110011111111000000111110000000101010101110000000000011100100000001011011100000000000001001011000110111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"))
a <- as.character(c("0000000000000000000000000000000000000000000011111011011001010011000100000001001011110011100110101000001100000100000001000110101011111101011010111110001010011111000101011011111111010010001111101110111001010001110011111111000000111110000000101010101110000000000011100100000001011011100000000000001001011000110111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"))
substring(a, seq(1,nchar(x),1))
substring(a, seq(1,nchar(a),1))
substring(a, seq(1,nchar(a),1), seq(2,nchar(a),1))
substring(a, seq(1,nchar(a)-1,1), seq(2,nchar(a),1))
substring(a, 1
)
substring(a, 1, 2)
substring(a, 1, 1)
substring(a, seq(1,nchar(a),1), seq(1,nchar(a),1))
b<-substring(a, seq(1,nchar(a),1), seq(1,nchar(a),1))
a==paste(b, sep='')
paste(b, sep='')
paste(b, sep='', collapse = T)
paste(b, sep='', collapse = "")
a==paste(b, sep='', collapse='')
which(b!=1)
which(b!=0)
length(which(b!=0))
a <- c('0000000000000000000000000000000000000000000011111011011001010011000100000001001011110011100110101000001100000100000001000110101011111101011010111110001010011111000101011011111111010010001111101110111001010001110011111111000000111110000000101010101110000000000011100100000001011011100000000000001001011000110111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000')
b<-substring(a, seq(1,nchar(a),1), seq(1,nchar(a),1))
a==paste(b, sep='', collapse='')
which(b!=0)
c('00000000000000000000000000000000000000000000')
nchar(c('00000000000000000000000000000000000000000000'))
nchar(a)
nchar('00000000000000000000000000000000000000000000')
nchar('00000000000000000000000000000000000000000000')
nchar('00000000000000000000000000000000000000000000')
nchar('00000000000000000000000000000000000000000000')
nchar(c('00000000000000000000000000000000000000000000'))
require(boot)
?boot.ci
ratio <- function(d, w) sum(d$x * w)/sum(d$u * w)
city.boot <- boot(city, ratio, R = 999, stype = "w", sim = "ordinary")
boot.ci(city.boot, conf = c(0.99),
type = c("BCa"))
boot.ci(city.boot, conf = c(0.99),
type = c("bca"))
getwd()
dat <- read.table('ISA_data.csv', sep=';', header=T)
View(dat)
dat[2]
dat[,1]
dat <- read.table('ISA_data.csv', sep=';', header=T, stringsAsFactors = F)
dat[,1]
dat[1,]
install.packages("adabag")
source('~/.active-rstudio-document', echo=TRUE)
source('~/.active-rstudio-document', echo=TRUE)
source('~/.active-rstudio-document', echo=TRUE)
library(adabag)
r.skew <- skew.rnorm(10000, mean = 10, skewness = -0.5)
library(espresso)
library(adabag)
r.skew <- skew.rnorm(10000, mean = 10, skewness = -0.5)
install.packages("adabag")
install.packages("adabag")
library(slidify)
publish(user='ausmeyer', repo='intro-biostats-epi')
publish(user='ausmeyer', repo='intro-biostats-epi')
publish(user='ausmeyer', repo='intro-biostats-epi')
?publish
publish
publish_deck
publish_github
library(slidify)
publish(user='ausmeyer', repo='intro-biostats-epi')
require(devtools)
install_github(c('slidify', 'slidifyLibraries'), 'ramnathv', ref = 'dev')
install_github('rCharts', 'ramnathv')
install_github('shiny', 'rstudio')
require(devtools)
install_github(c('slidify', 'slidifyLibraries'), 'ramnathv', ref = 'dev')
install_github('rCharts', 'ramnathv')
install_github('shiny', 'rstudio/shiny')
install_github('ramanathv/rCharts')
install.packages('nvd3')
install_github('ramnathv/slidify')
install_github('ramnathv/slidifyLibraries')
require(devtools)
install_github('ramnathv/slidify')
install_github('ramnathv/slidifyLibraries')
pkgs <- c("slidify", "slidifyLibraries", "rCharts")
devtools::install_github(pkgs, "ramnathv", ref = "dev")
pkgs <- c("slidify", "slidifyLibraries", "rCharts")
devtools::install_github(pkgs, "ramnathv", ref = "dev")
source('~/.active-rstudio-document', echo=TRUE)
library(devtools)
install_github('slidify', 'ramnathv')
install_github('slidifyLibraries', 'ramnathv')
install.packages(c("plyr", "ggplot2","rgeos", "maptools")))
install.packages(c("plyr", "ggplot2","rgeos", "maptools"))
install.packages('shiny')
library(shiny)
runExample("01_hello")
runExample("01_hello")
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
install.packages("gridExtra")#sthash.p2qtKq04.dpuf
install.packages("gridExtra")
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/shiny-quiz')
shiny::runApp('~/Websites/intro-biostats-epi/assets/apps/predictive_value')
runGitHub("https://github.com/ausmeyer/predictive_value_shiny", "ausmeyer")
runGitHub("predictive_value_shiny", "ausmeyer")
require(shiny)
require(shiny)
runGitHub("predictive_value_shiny", "ausmeyer")
install.packages('devtools')
devtools::install_github('rstudio/rsconnect')
rsconnect::setAccountInfo(name='ausmeyer',
token='71E01EE088DE8008E5850F9D48A883BB',
secret='jMaxv6eZ65N+yFh8bL4yhdO7noHNhHGO3t4iCjrA')
library(rsconnect)
rsconnect::deployApp('~/Websites/predictive_value_shiny')
setwd('~/Websites/intro-biostats-epi/')
require(slidify)
publish(user='ausmeyer', repo='intro-biostats-epi')