-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
512 lines (512 loc) · 36.9 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
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<ornithologists\\>)", replacement="ornithologist")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<outdoors\\>)", replacement="outdoor")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<painter\\>|\\<painting\\>)", replacement="paint")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<pennies\\>)", replacement="penny")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<performance\\>)", replacement="perform") #as in doing somehting for others to see.
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<petting\\>)", replacement="pet")
#"physical science" -> physics, physical as related to physics -> "physics". All other instances of "physical" kept. Changes done directly in excerpts.
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<pieces\\>)", replacement="piece")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<pigs\\>)", replacement="pig")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<planting\\>)", replacement="plant")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<pointing\\>)", replacement="point")
#pose as in pose questions changed to ask in excerpt.
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<possibly\\>)", replacement="possible")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<potentially\\>)", replacement="potential")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<programs\\>)", replacement="program")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<promoted\\>|\\<promoting\\>)", replacement="promote")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<prompting\\>)", replacement="prompt")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<purposes\\>)", replacement="purpose")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<pushing\\>)", replacement="push")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<puzzling\\>)", replacement="puzzle")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<rains\\>|\\<rainfall\\>)", replacement="rain")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<randomly\\>)", replacement="random")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<ranged\\>)", replacement="range")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<ratings\\>)", replacement="rating")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<reactions\\>)", replacement="react")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<readings\\>|\\<reading\\>|\\<read\\>)", replacement="read")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<readily\\>)", replacement="ready")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<reasons\\>)", replacement="reason")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<recalling\\>)", replacement="recall")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<received\\>)", replacement="receiving")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<recognised\\>)", replacement="recognise")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<records\\>)", replacement="record")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<resonant\\|\\<resonated\\>)", replacement="resonate")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<respects\\>)", replacement="respect")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<responding\\|\\<responded\\|\\<responds\\>)", replacement="respond")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<resulted\\>)", replacement="result")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<returning\\>)", replacement="return")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<revealed\\>)", replacement="reveal")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<rocks\\>)", replacement="rock")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<routes\\>)", replacement="route")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<routines\\>)", replacement="routine")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<safely\\>)", replacement="safety")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<samples\\>)", replacement="sample")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<sandy\\>)", replacement="sand")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<saw\\>|\\<seeing\\>|\\<seen\\>)", replacement="see")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<says\\>|\\<said\\>)", replacement="say")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<scales\\>)", replacement="scale")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<schooling\\>)", replacement="school")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<seasonal\\>|\\<seasons\\>)", replacement="season")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<sections\\>)", replacement="section")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<seeds\\>)", replacement="seed")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<senses\\>)", replacement="sense")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<separated\\>|\\<seperately\\>)", replacement="separate")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<sequences\\>)", replacement="sequence")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<sat\\>|\\<setting\\>)", replacement="set") #as in the act of setting stuff up
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<shapes\\>)", replacement="shape")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<sharable\\>|\\<sharing\\>|\\<shared\\>)", replacement="share")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<shells\\>)", replacement="shell")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<significance\\>)", replacement="significant")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<sixth\\>)", replacement="six")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<slowmations\\>)", replacement="slowmation")
#small groups and small group changed to smallgroup directly in excerpts.
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<smelling\\>|\\<smelly\\>)", replacement="smell")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<snails\\>)", replacement="snail")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<snowfall\\>)", replacement="snow")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<somethings\\>)", replacement="something")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<songs\\>)", replacement="song")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<sorted\\>)", replacement="sort")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<spanned\\>)", replacement="spans")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<specifically\\>)", replacement="specific")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<speeding\\>)", replacement="speed")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<spilled\\>)", replacement="spill")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<splits\\>)", replacement="split")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<spontaneously\\>)", replacement="spontaneous")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<spots\\>)", replacement="spot")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<squeezed\\>)", replacement="squeeze")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<standardize\\>|\\<standards\\>)", replacement="standard")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<stereotypical\\>)", replacement="stereotype")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<stopped\\>)", replacement="stop")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<stored\\>)", replacement="store")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<strategies\\>|\\<strategic\\>)", replacement="strategy")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<strengths\\>)", replacement="strength")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<stretching\\>|\\<stretched\\>)", replacement="stretch")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<striped\\>)", replacement="stripes")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<striving\\>)", replacement="strive")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<suitability\\>)", replacement="suitable")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<survive\\>)", replacement="survival")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<stretching\\>|\\<stretched\\>)", replacement="stretch")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<symbolic\\>|\\<symbols\\>)", replacement="symbol")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<table2\\>|\\<table1\\>)", replacement="table")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<teams\\>)", replacement="team")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<tells\\>)", replacement="tell")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<textbook\\>|\\<texts\\>)", replacement="text")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<things\\>)", replacement="thing")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<thinking\\>|\\<thinks\\>)", replacement="think")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<tools\\>)", replacement="tool")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<totally\\>)", replacement="total")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<towards\\>)", replacement="toward")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<toys\\>)", replacement="toy")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<tracing\\>)", replacement="trace")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<tracks\\>)", replacement="track")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<training\\>)", replacement="train")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<transformed\\>)", replacement="transform")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<transitioning\\>|\\<transitioned\\>)", replacement="transition")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<triggered\\>)", replacement="triggers")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<trying\\>)", replacement="try")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<tubs\\>)", replacement="tub")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<turned\\>)", replacement="turn") #as in focused their attention on, whereas "turns" relates to taking turns.
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<twisting\\>|\\<twisted\\>)", replacement="twist") #as in the action of turning something, not "with a twist".
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<underlying\\>)", replacement="underlie")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<utilizing\\>|\\<utilized\\>)", replacement="utilize")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<valuable\\>|\\<valuing\\>|\\<valued\\>|\\<values\\>)", replacement="value") #hmmm..
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<variables\\>)", replacement="variable") #as in concept of "a variable" parameter
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<vignettes\\>)", replacement="vignette")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<vocabularies\\>)", replacement="vocabulary")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<went\\>)", replacement="go")
#whats changed to what is
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<walked\\>|\\<walks\\>>|\\<walking\\>>)", replacement="walk") # as in either "to walk" and "a walk".
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<wanted\\>)", replacement="want")
#wasnt changed to was not in excerpt
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<watching\\>)", replacement="watch")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<weeks\\>|\\<weekly\\>>)", replacement="week")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<watching\\>)", replacement="watch")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<wooden\\>)", replacement="wood")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<worked\\>)", replacement="work") #but not "workers"
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<worlds\\>)", replacement="world")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<younger\\>)", replacement="young")
#Spliting words
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<subtopic\\>|\\<subtopics\\>)", replacement="sub topic")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<threephase\\>)", replacement="three phase")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<twophase\\>)", replacement="two phase")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<threeweek\\>)", replacement="three week")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<videotaped\\>)", replacement="video taped")
#theres (as in there's) changed to "there is" directly in excerpts
#Specific names -> function in study
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<james\\>)", replacement="example_child") #example_child is a fictional child used in instructional materials.
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<tom\\>)", replacement="example_child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<john\\>)", replacement="example_child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<gina\\>)", replacement="example_child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<tony\\>)", replacement="example_child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<lilly\\>)", replacement="example_animal")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<thelmas\\>)", replacement="example_animal")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<jane\\>)", replacement="study_scienctist") #a rolemodel for childreni n the study??
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<peter\\>)", replacement="study_scienctist")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<chris\\>)", replacement="study_scienctist")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<johannah\\>)", replacement="study_child") #a child observed and analysed in the study
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<lily\\>)", replacement="study_child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<lucy\\>)", replacement="study_child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<markus\\>)", replacement="study_child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<simon\\>)", replacement="study_child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<susie\\>|\\<susies\\>|\\<susieastheball\\>|\\<susie3\\>)", replacement="study_child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<cora\\>)", replacement="study_teacher")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<mrstreadwell\\>)", replacement="study_teacher")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<mrscasey\\>)", replacement="study_teacher")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<becky\\>)", replacement="study_teacher")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<shane\\>)", replacement="study_teacher")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<ppts\\>)", replacement="study_teacher")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<pts\\>)", replacement="study_teacher")
#May 9th 2020: Changed Child: and other instances of named or specific children that appear in studies to "study_child".
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<wouassammeeschtendran\\>)", replacement="non-english-sentence")
##SYNONYMS
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<Empirical\\>|\\<theories\\>|\\<theories\\>|\\<theory\\>)", replacement="theory")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<certain\\>)", replacement="specific")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<elementary\\>)", replacement="primary")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<constitue element\\>)", replacement="phase")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<inquiry_based\\>|\\<inquirybased\\>|\\<inquiryframed\\>|\\<inquiryoriented\\>)", replacement="ibse")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<directed\\>|\\<directing\\>|\\<direct\\>|\\<instructed\\>|\\<instruct\\>|\\<steer\\>)", replacement="instruct_guide")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<curiosity\\>|\\<interesting\\>|\\<interests\\>|\\<interests\\>|\\<interested\\>)", replacement="interest")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<instructors\\>)", replacement="educators")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<teacher trainer\\>|\\<pilot centre trainer\\>|\\<the trainer\\>)", replacement="teacher_trainer")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<kids\\>)", replacement="child")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<likely\\>|\\<probably\\>)", replacement="probable")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<lives\\>|\\<live\\>)", replacement="live_habitat") #lives as in plural of life -> life.
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<pretence\\>|\\<pretend\\>|\\<pretending\\>|\\<makebelieve\\>|\\<played\\>|\\<playing\\>)", replacement="play")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<onus\\>|\\<responsibilities\\>)", replacement="responsibility")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<papers\\>)", replacement="article") #papers in plural only used as articles in excerpts.
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<photographing\\>|\\<photographer\\>|\\<photographed\\>|\\<photos\\>|\\<photo\\>|\\<pictogram\\>|\\<pictures\\>)", replacement="picture")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<playdough\\>)", replacement="playdoh")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<prints\\>)", replacement="print")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<previously\\>|\\<prior\\>)", replacement="previous")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<immediately\\|\\<promptly\\>>)", replacement="immediate")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<pupils>\\)", replacement="pupil")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<reasoning\\>)", replacement="thinking")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<schoolyard\\>)", replacement="playground")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<sciencey\\>)", replacement="sciencelike")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<book\\>)", replacement="text")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<at times\\>|\\<at other times\\>>)", replacement="sometimes")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<track\\>|\\<trace\\>>)", replacement="track_trace")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<tubs\\>|\\<bathtub\\>>)", replacement="tub")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<tv\\>)", replacement="television")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<vs\\>)", replacement="versus")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<secondgrade\\>)", replacement="2ndgrade")
allEmpirical <- tm_map(allEmpirical, content_transformer(gsub), pattern = "(\\<first graders\\>)", replacement="1stgrade")
wordstoremove<-c(stopwords("english"),"can","also","although","may","maybe","moreover","mostly","onto","per se", "really","therefore","though","thus",
"xl011","xl021","xl051","xl071","xn011","xn031","xn051","xn071","xq011","xq031","xq041","xq051","xs021","xs091","xs111","xs121",
"2013appendixfp10","20132014","1b","p234","p141")
#allFilesx <- tm_map(allFilesx, removeWords, c("endoffile"))
allEmpirical<-tm_map(allEmpirical,stripWhitespace)
myWordNetwork <- function (txt,j.words) {
# Clean data
#remove capitalization
#corpus.temp <- tm_map(corpus, tolower)
#Remove punctuations and other unnecessary things
#corpus.removed.punc <- tm_map(corpus.temp, removePunctuation)
#Remove numbers
#corpus.removed.numb <- tm_map(corpus.removed.punc, removeNumbers)
#Remove Whitespaces
#corpus.removed.white <- tm_map(corpus.removed.punc, stripWhitespace)
#corpus <- Corpus(DataframeSource(data.frame(data)))
#prepare for stemming (language is english, but TM has a package for other
#languages)
#corpus.temp <- corpus.removed.white
#corpus.copy <- corpus.temp
#corpus.temp <- tm_map(corpus.temp, stemDocument, language = language)
#corpus.final <- tm_map(corpus.temp, stemCompletion,
# dictionary = corpus.copy)
#corpus.final<-corpus.temp
#Prepare to remove "stopwords" such as "A", "The", e.t.c.
# keep "declarative words"
#my.stopwords <- stopwords("english")
#my.stopwords <- my.stopwords[!(my.stopwords %in% j.words)]
#Remove stopwrods
#corpus.crop <- tm_map(corpus.removed.white,removeWords,c(my.stopwords))
# Create edge list for export
edge.list <-strsplit(as.matrix(txt), split = " ")[[1]]
#Remove unnecessary
#edge.list<-as.matrix(corpus.final[[1]])
#edge.list <- edge.list[edge.list!=""]
#edge.list<-strsplit(edge.list,split=" ")
# index of "declarative words" (the -1 is because we're removing first and
# last word to make it into a word-network
node.num <- length(edge.list[!(edge.list %in% j.words)]) - 1
#Create matrix to be exported
export.edge.list <- array("",dim=c(node.num,2))
#Set column names as per Gephi requirements
#colnames(export.edge.list) <- c("Source","Target","Label")
# Put source word except the "joining words into the matrix to be exported
export.edge.list[,1] <- edge.list[!(edge.list %in% j.words)][-length(edge.list[!(edge.list %in% j.words)])]
# put the target word except the "joining words into the matrix to be exported
export.edge.list[,2] <- edge.list[!(edge.list %in% j.words)][-1]
#Go through the joining words and put them in
# for(i in j.words) {
# for (j in which(edge.list %in% i)) {
# export.edge.list[j - sum(!which(edge.list %in% j.words) > j), 3] <- i
# }
#}
return(export.edge.list)
}
edgelistsEmpirical<-lapply(allEmpirical,myWordNetwork,j.words=wordstoremove)
graphsEmpirical<-list()
for (i in 1:35){
graphsEmpirical[[i]]<-graph.edgelist(edgelists[[i]],directed=T)
}
allEdgeEmpirical<-rbind(edgelistsEmpirical[[1]],edgelistsEmpirical[[2]],edgelistsEmpirical[[3]],edgelistsEmpirical[[4]],edgelistsEmpirical[[5]],edgelistsEmpirical[[6]],edgelistsEmpirical[[7]],edgelistsEmpirical[[8]],edgelistsEmpirical[[9]],edgelistsEmpirical[[10]],
edgelistsEmpirical[[11]],edgelistsEmpirical[[12]],edgelistsEmpirical[[13]],edgelistsEmpirical[[14]],edgelistsEmpirical[[15]],edgelistsEmpirical[[16]],edgelistsEmpirical[[17]],edgelistsEmpirical[[18]],edgelistsEmpirical[[19]],edgelistsEmpirical[[20]],
edgelistsEmpirical[[21]],edgelistsEmpirical[[22]],edgelistsEmpirical[[23]],edgelistsEmpirical[[24]],edgelistsEmpirical[[25]],edgelistsEmpirical[[26]],edgelistsEmpirical[[27]],edgelistsEmpirical[[28]],edgelistsEmpirical[[29]],edgelistsEmpirical[[30]],
edgelistsEmpirical[[31]],edgelistsEmpirical[[32]],edgelistsEmpirical[[33]],edgelistsEmpirical[[34]],edgelistsEmpirical[[35]])
articlesE<-lapply(edgelistsEmpirical,graph.edgelist,directed=T)
for (i in 1:length(articlesE)){
E(articlesE[[i]])$weight<-1
articlesE[[i]]<-simplify(articlesE[[i]],edge.attr.comb="sum")
articlesE[[i]]<-delete.vertices(articlesE[[i]],which(V(articlesE[[i]])$name=="break"))
}
article01E<-graph.edgelist(edgelistsEmpirical[[1]],directed=T)
article02E<-graph.edgelist(edgelistsEmpirical[[2]],directed=T)
article03E<-graph.edgelist(edgelistsEmpirical[[3]],directed=T)
article04E<-graph.edgelist(edgelistsEmpirical[[4]],directed=T)
article05E<-graph.edgelist(edgelistsEmpirical[[5]],directed=T)
article06E<-graph.edgelist(edgelistsEmpirical[[6]],directed=T)
article07E<-graph.edgelist(edgelistsEmpirical[[7]],directed=T)
article08E<-graph.edgelist(edgelistsEmpirical[[8]],directed=T)
article09E<-graph.edgelist(edgelistsEmpirical[[9]],directed=T)
article10E<-graph.edgelist(edgelistsEmpirical[[10]],directed=T)
article11E<-graph.edgelist(edgelistsEmpirical[[11]],directed=T)
article12E<-graph.edgelist(edgelistsEmpirical[[12]],directed=T)
article13E<-graph.edgelist(edgelistsEmpirical[[13]],directed=T)
article14E<-graph.edgelist(edgelistsEmpirical[[14]],directed=T)
article15E<-graph.edgelist(edgelistsEmpirical[[15]],directed=T)
article16E<-graph.edgelist(edgelistsEmpirical[[16]],directed=T)
article17E<-graph.edgelist(edgelistsEmpirical[[17]],directed=T)
article18E<-graph.edgelist(edgelistsEmpirical[[18]],directed=T)
article19E<-graph.edgelist(edgelistsEmpirical[[19]],directed=T)
article20E<-graph.edgelist(edgelistsEmpirical[[20]],directed=T)
article21E<-graph.edgelist(edgelistsEmpirical[[21]],directed=T)
article22E<-graph.edgelist(edgelistsEmpirical[[22]],directed=T)
article23E<-graph.edgelist(edgelistsEmpirical[[23]],directed=T)
article24E<-graph.edgelist(edgelistsEmpirical[[24]],directed=T)
article25E<-graph.edgelist(edgelistsEmpirical[[25]],directed=T)
article26E<-graph.edgelist(edgelistsEmpirical[[26]],directed=T)
article27E<-graph.edgelist(edgelistsEmpirical[[27]],directed=T)
article28E<-graph.edgelist(edgelistsEmpirical[[28]],directed=T)
article29E<-graph.edgelist(edgelistsEmpirical[[29]],directed=T)
article30E<-graph.edgelist(edgelistsEmpirical[[30]],directed=T)
article31E<-graph.edgelist(edgelistsEmpirical[[31]],directed=T)
article32E<-graph.edgelist(edgelistsEmpirical[[32]],directed=T)
article33E<-graph.edgelist(edgelistsEmpirical[[33]],directed=T)
article34E<-graph.edgelist(edgelistsEmpirical[[34]],directed=T)
article35E<-graph.edgelist(edgelistsEmpirical[[35]],directed=T)
allNetEmpirical<-graph.edgelist(allEdgeEmpirical,directed=T)
E(allNetEmpirical)$weight<-1
allNetEmpirical<-delete.vertices(allNetEmpirical,v = which(V(allNetEmpirical)$name=="break"))
allNetEmpirical<-simplify(allNetEmpirical,remove.multiple=T,edge.attr.comb=list(weight="sum"))
prE<-page.rank(allNetEmpirical)
V(allNetEmpirical)$pr<-prE$vector
sort(prE$vector,decreasing = T)[1:10]
fgE<-fastgreedy.community(as.undirected(allNetEmpirical))
write.csv(V(allNetEmpirical)$name,"listNodesEmpirical.csv")
source("R_scripts/backboneExtraction.r")
V(allNetEmpirical)$id<-V(allNetEmpirical)$name
V(allNetTheoretical)$id<-V(allNetTheoretical)$name
freq<-strength(allNetTheoretical,mode = "all")
theoreticalBB<-backboneNetwork(allNetTheoretical,evalFunc = 1, alpha = 0.001)
fgTBB<-fastgreedy.community(as.undirected(theoreticalBB))
fgTBB
fgTBB$membership
table(fgTBB$membership)
Wij<-function(j,mem,g){
M<-length(unique(mem))
m<-which(mem==j)
dfm<-data.frame()
for(i in 1:length(m)){
x<-incident(g,m[i],mode="in")
a<-ends(g, x,names=F)
b<-get.edge.attribute(g,name="weight",x)
c<-mem[a[,1]] #HMMM:..
dfm<-rbind(dfm,data.frame(a,weight=b,module=c))
}
V<-vector()
for(l in 1:M){
V[l]<-sum(dfm$weight[dfm$module==l])
}
return(V)
}
makemap<-function(mem,g){
M<-length(unique(mem))
W<-matrix(NA,ncol=M,nrow=M)
for(j in 1:length(unique(mem))){
W[j,]<-Wij(j,mem,g)
}
##naming modules based on 10 largest pageranks
pr<-page.rank(g)
modulenames<-vector()
for(k in 1:length(unique(mem))){
modulenames[k]<-paste(c(k,names(sort(pr$vector[mem==k],decreasing = T)[1:3])),collapse = ";")
}
internalLinks<-diag(W)
n_words<-as.vector(table(mem))
h<-graph.adjacency(W,mode=c("directed"),weighted = T,diag = F)
V(h)$name<-modulenames #names of the 10 higest pagerank words in them module
V(h)$id<-modulenames
V(h)$n_words<-n_words #how many words in module
V(h)$internallinks<-internalLinks #how many internal links are in each module
return(h)
}
mapTheoretical<-makemap(fgTBB$membership,theoreticalBB)
mapTheoretical
mapTheoreticalrem<-delete.vertices(mapTheoretical,1)
mapTremBB<-backboneNetwork(mapTheoreticalrem,0.005,1)
V(mapTremBB)$n_words<-V(mapTheoreticalrem)$n_words
mapTremBB<-decompose.graph(mapTremBB)[[1]]
fgMTremBB<-fastgreedy.community(as.undirected(mapTremBB))
V(mapTremBB)$fastgreedy<-fgMTremBB$membership
V(mapTremBB)
mapTremBB
V(mapTremBB)$id
V(mapTremBB)$conceptualisations<-1
V(mapTBBrem)$concptualisations[c(10,11)]<-3
V(mapTBBrem)$concptualisations
V(mapTremBB)$conceptualisations<-1
V(mapTBBrem)$concptualisations
V(mapTBBrem)$conceptualisations
V(mapTBBrem)$conceptualisations<-1
V(mapTBBrem)$conceptualisations
V(mapTBBrem)$concptualisations[c(10,11)]<-3
V(mapTBBrem)$conceptualisations
V(mapTBBrem)$conceptualisations[c(10,11)]<-3
V(mapTBBrem)$conceptualisations[c(1,2,3,6,7,14,16)]<-3
V(mapTBBrem)$conceptualisations
V(mapTBBrem)$conceptualisations[c(1,2,3,6,7,14,16)]<-2
V(mapTBBrem)$conceptualisations
which(V(mapTBBrem)$conceptualisations==1)
V(mapTBBrem)$id[V(mapTBBrem)$conceptualisations==1]
V(mapTBBrem)$name[V(mapTBBrem)$conceptualisations==1]
mapTBBrem
mapTremBB
V(mapTremBB)$conceptualisations
V(mapTremBB)$conceptualisations[c(10,11)]<-3
V(mapTremBB)$conceptualisations[c(1,2,3,6,7,14,16)]<-2
V(mapTremBB)$conceptualisations
V(mapTremBB)$id[V(mapTremBB)$conceptualisations==1]
V(mapTremBB)$id[V(mapTremBB)$conceptualisations==2]
V(mapTremBB)$id[V(mapTremBB)$conceptualisations==3]
V(mapTremBB)$conceptualisations<-1
mapTremBB
V(mapTremBB)$conceptualisations
V(mapTremBB)$conceptualisations[c(10,11)]
V(mapTremBB)$conceptualisations[c(10,11)]<-3
V(mapTremBB)$conceptualisations[c(1,2,3,6,7,9,14,16)]<-2
mapOfCona<-makemap(V(mapTremBB)$conceptualisations,mapTremBB)
mapOfCona
plot(mapOfCona)
mapTremBB
mapOfCona
V(mapofCona)$n_words
V(mapOfCona)$n_words
E(mapOfCona)$n_words
E(mapOfCona)$weight
write.graph(mapOfCona,"mapmap.graphml",format="graphml")
mapTheoreticalrem
V(mapTheoreticalrem)$id
plot(mapTheoreticalrem)
E(mapTheoreticalrem)
get.edges(mapTheoreticalrem)
get.edges(mapTheoreticalrem,E(mapTheoreticalrem))
get.edges(mapTheoreticalrem,3
)
get.edges(mapTheoreticalrem)
get.edges(mapTheoreticalrem,E(mapTheoreticalrem))
E(mapTheoreticalrem)
E(mapTheoreticalrem)[51]
get.edges(mapTheoreticalrem,E(mapTheoreticalrem))
E(mapTheoreticalrem)[32]
E(mapTheoreticalrem)$weight[32]
E(mapTheoreticalrem)$weight[217]
toFromT<-get.edges(theoreticalBB,E(theoreticalBB))
length(toFromT[,1])
theoreticalBB
toFromT[fgTBB$membership==1,1]
toFromT[fgTBB$membership==3,]
toFromT[1:19,]
V(theoreticalBB)[toFromT[1:19,1]]
which(V(theoreticalBB)$id=="teacher")
fgTBB$modularity[V(theoreticalBB)$id=="teacher"]
fgTBB$membership[V(theoreticalBB)$id=="teacher"]
fgTBB$membership[V(theoreticalBB)]
fgTBB$membership[toFromT]
fgTBB$membership[toFromT[,1]]
toFromTCluster<-data.frame(fgTBB$membership[toFromT[,1]],fgTBB$membership[toFromT[,2]])
toFromTCluster
toFromCluster[toFromCluster[,1]==3]
toFromTCluster[toFromTCluster[,1]==3]
toFromTCluster[toFromTCluster[,1]==3,]
toFromTCluster[toFromTCluster[,1]==3 & toFromTCluster[,2]==16,]
toFromTCluster[toFromTCluster[,1]==16 & toFromTCluster[,2]==3,]
makemap<-function(mem,g){
M<-length(unique(mem))
W<-matrix(NA,ncol=M,nrow=M)
for(j in 1:length(unique(mem))){
W[,j]<-Wij(j,mem,g) #was W[j,i] - trying out this on June 21st 2020
}
##naming modules based on 10 largest pageranks
pr<-page.rank(g)
modulenames<-vector()
for(k in 1:length(unique(mem))){
modulenames[k]<-paste(c(k,names(sort(pr$vector[mem==k],decreasing = T)[1:3])),collapse = ";")
}
internalLinks<-diag(W)
n_words<-as.vector(table(mem))
h<-graph.adjacency(W,mode=c("directed"),weighted = T,diag = F)
V(h)$name<-modulenames #names of the 10 higest pagerank words in them module
V(h)$id<-modulenames
V(h)$n_words<-n_words #how many words in module
V(h)$internallinks<-internalLinks #how many internal links are in each module
return(h)
}
mapTheoretical<-makemap(fgTBB$membership,theoreticalBB)
mapTheoreticalrem<-delete.vertices(mapTheoretical,1)
mapTremBB<-backboneNetwork(mapTheoreticalrem,0.005,1)
V(mapTremBB)$n_words<-V(mapTheoreticalrem)$n_words
mapTremBB<-decompose.graph(mapTremBB)[[1]]
fgMTremBB<-fastgreedy.community(as.undirected(mapTremBB))
V(mapTremBB)$fastgreedy<-fgMTremBB$membership
write.graph(mapTremBB,"mapTBBrem21062020.graphml",format="graphml")
mapEmpirical<-makemap(fgEBB$membership,empiricalBB)
mapEBB<-backboneNetwork(mapEmpirical,0.005,1)
V(mapEBB)$n_words<-V(mapEmpirical)$n_words
mapEBB<-decompose.graph(mapEBB)[[1]]
fgMEBB<-fastgreedy.community(as.undirected(mapEBB))
V(mapEBB)$fastgreedy<-fgMEBB$membership
mapEmpiricalrem<-delete.vertices(mapEmpirical,13)
mapEremBB<-backboneNetwork(mapEmpiricalrem,0.005,1)
V(mapEremBB)$n_words<-V(mapEmpiricalrem)$n_words
mapEremBB<-decompose.graph(mapEremBB)[[1]]
fgMEremBB<-fastgreedy.community(as.undirected(mapEremBB))
V(mapEremBB)$fastgreedy<-fgMEremBB$membership
write.graph(mapEremBB,"mapEBB13rem21062020.graphml",format="graphml")
mapTBB<-backboneNetwork(mapTheoretical,0.005,1)
V(mapTBB)$n_words<-V(mapTheoretical)$n_words
mapTBB<-decompose.graph(mapTBB)[[1]]
fgMTBB<-fastgreedy.community(as.undirected(mapTBB))
V(mapTBB)$fastgreedy<-fgMTBB$membership
write.graph(mapTBB,"mapTBB21062020.graphml",format="graphml")
toFromTCluster[toFromTCluster[,1]==6 & toFromTCluster[,2]==2,]
E(theoreticalBB)$weight[495]
E(theoreticalBB)$weight[1336]
toFromTCluster[toFromTCluster[,1]==6 & toFromTCluster[,2]==16,]
toFromTCluster[toFromTCluster[,1]==6 & toFromTCluster[,2]==3,]
fgMTBB
fgMTremBB
mapEmpirical<-makemap(fgEBB$membership,empiricalBB)
mapEBB<-backboneNetwork(mapEmpirical,0.005,1)
V(mapEBB)$n_words<-V(mapEmpirical)$n_words
mapEBB<-decompose.graph(mapEBB)[[1]]
fgMEBB<-fastgreedy.community(as.undirected(mapEBB))
V(mapEBB)$fastgreedy<-fgMEBB$membership
write.graph(mapEBB,"mapEBB21062020.graphml",format="graphml")
fgMEBB
mapTremBB
fgMTremBB
allEmpirical
save(allEmpirical, file = "allEmpirical.RData")
load("allEmpirical.RData")