Skip to content

Commit be879f8

Browse files
committedApr 25, 2022
clean start
1 parent 58a04e8 commit be879f8

21 files changed

+14691
-1
lines changed
 

‎.DS_Store

0 Bytes
Binary file not shown.

‎LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 AdrianTimpson
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎NEWS.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<a href="https://github.com/UCL"><img src="tools/logos/logo_UCL.png" alt="UCL Research Software Development" height="70"/></a>
2+
<a href="https://www.ucl.ac.uk/biosciences/departments/genetics-evolution-and-environment/research/molecular-and-cultural-evolution-lab"><img src="tools/logos/logo_MACElab.png" alt="UCL Research Software Development" height="70"/></a>
3+
4+
# UCL-RAP build history
5+
6+
## 2021-07-28
7+
* Corrected URL link examples to a wordcloud image - direct link to raw files required.
8+
* Guide to embedding wordclouds using Drupal
9+
10+
## 2021-05-21
11+
* Specific word corrections can be made by appending to /tools/corrections/corrections.csv
12+
13+
## 2021-05-18
14+
* Auto resizing to 600 px width. Height will vary.
15+
* New sizing algorithm also considers relative width of characters.
16+
17+
## 2021-05-14
18+
* Scrapped working repository at AdrianTimpson/UCL-RAP mirroring to UCL/RAP in favour of a single repository at UCL/RAP
19+
* Automatic cropping of .png using imagemagick
20+
* Cleared entire repository and started fresh, so will take several days before all wordclouds are regenerated
21+
22+
## 2021-05-12
23+
* Refactored R scripts for speed ups
24+
* Clouds now generated daily, but only for a small subset of UPIs and departments done (least recent). Therefore all UPIs and Depts are updated every few weeks.
25+
26+
## 2021-01-06
27+
* New R script 'generate wordcloud for each department.R'.
28+
* New R script 'generate list of UPIs.R'.
29+
* New R script 'generate list of department codes.R'.
30+
31+
## 2021-01-05
32+
* New R script 'generate wordcloud for each UPI.R'. So far only researchers from GEE are included in the UPI lists.
33+
34+
## 2021-01-04
35+
* Initial creation
36+
37+
38+

‎R/boilerplate.R

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#---------------------------------------------------------------------------
2+
# A bunch of libraries. Not all are needed for every script, but doesn't cost much to run anyway
3+
#---------------------------------------------------------------------------
4+
library(udpipe)
5+
library(wordcloud2)
6+
library(webshot)
7+
library(htmlwidgets)
8+
library(SemNetCleaner)
9+
library(stringi)
10+
library(rvest)
11+
library(stringr)
12+
library(RCurl)
13+
library(png)
14+
source('functions.R')
15+
#---------------------------------------------------------------------------
16+
#---------------------------------------------------------------------------

‎R/controller.R

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#-------------------------------------------------------------------------------------------
2+
# Single script to run all other required R scripts, so can be envoked automatically on server using CRON
3+
#-------------------------------------------------------------------------------------------
4+
source('boilerplate.R')
5+
install_phantomjs(force = TRUE)
6+
7+
#ud_model <- udpipe_download_model(language = "english", model_dir='../tools/data')
8+
#ud_model <- udpipe_load_model(ud_model$file_model)
9+
ud_model <- udpipe_load_model('../tools/data/english-ewt-ud-2.5-191206.udpipe')
10+
#-------------------------------------------------------------------------------------------
11+
correction.tidy()
12+
Sys.time()
13+
source('generate list of UPIs.R')
14+
Sys.time()
15+
source('generate wordcloud for each UPI.R')
16+
Sys.time()
17+
source('generate list of department codes.R')
18+
Sys.time()
19+
source('generate wordcloud for each department.R')
20+
Sys.time()
21+
#-------------------------------------------------------------------------------------------
22+
23+
#-------------------------------------------------------------------------------------------
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+

‎R/controller.Rout

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
3+
Copyright (C) 2020 The R Foundation for Statistical Computing
4+
Platform: x86_64-apple-darwin15.6.0 (64-bit)
5+
6+
R is free software and comes with ABSOLUTELY NO WARRANTY.
7+
You are welcome to redistribute it under certain conditions.
8+
Type 'license()' or 'licence()' for distribution details.
9+
10+
Natural language support but running in an English locale
11+
12+
R is a collaborative project with many contributors.
13+
Type 'contributors()' for more information and
14+
'citation()' on how to cite R or R packages in publications.
15+
16+
Type 'demo()' for some demos, 'help()' for on-line help, or
17+
'help.start()' for an HTML browser interface to help.
18+
Type 'q()' to quit R.
19+
20+
> #-------------------------------------------------------------------------------------------
21+
> # Single script to run all other required R scripts, so can be envoked automatically on server using CRON
22+
> #-------------------------------------------------------------------------------------------
23+
> source('boilerplate.R')
24+
Loading required package: SemNetDictionaries
25+
26+
SemNetDictionaries
27+
For help getting started, see <https://doi.org/10.31234/osf.io/eht87>
28+
29+
Submit your own dictionary and moniker glossaries to:
30+
<https://github.com/AlexChristensen/SemNetDictionaries/issues/new/choose>
31+
32+
SemNetCleaner
33+
For help getting started, see <https://doi.org/10.31234/osf.io/eht87>
34+
For bugs and errors, submit an issue to <https://github.com/AlexChristensen/SemNetCleaner/issues>
35+
36+
WARNING: There have been major updates to the SemNetCleaner package.
37+
Please see 'Package NEWS' for a detailed list of updates (see 'Changes in version 1.2.0')
38+
39+
> install_phantomjs(force = TRUE)
40+
% Total % Received % Xferd Average Speed Time Time Time Current
41+
Dload Upload Total Spent Left Speed
42+
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 663 100 663 0 0 1462 0 --:--:-- --:--:-- --:--:-- 1460
43+
1 16.3M 1 175k 0 0 138k 0 0:02:00 0:00:01 0:01:59 138k 73 16.3M 73 12.0M 0 0 5433k 0 0:00:03 0:00:02 0:00:01 11.8M100 16.3M 100 16.3M 0 0 7132k 0 0:00:02 0:00:02 --:--:-- 14.9M
44+
phantomjs has been installed to /Users/admin/Library/Application Support/PhantomJS
45+
>
46+
> #ud_model <- udpipe_download_model(language = "english", model_dir='../tools/data')
47+
> #ud_model <- udpipe_load_model(ud_model$file_model)
48+
> ud_model <- udpipe_load_model('../tools/data/english-ewt-ud-2.5-191206.udpipe')
49+
> #-------------------------------------------------------------------------------------------
50+
> correction.tidy()
51+
> Sys.time()
52+
[1] "2022-04-25 03:05:10 BST"
53+
> source('generate list of UPIs.R')
54+
Error in UseMethod("html_table") :
55+
no applicable method for 'html_table' applied to an object of class "xml_missing"
56+
Calls: source -> withVisible -> eval -> eval -> %>% -> html_table
57+
Execution halted

0 commit comments

Comments
 (0)