Skip to content

Commit 13064ed

Browse files
committed
add revisions
2 parents d964aea + 64cbec5 commit 13064ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4000
-1
lines changed

R/scrape_emoticons.R

+20
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,22 @@ library(dplyr)
88
# url <- "http://apps.timwhitlock.info/emoji/tables/unicode"
99

1010
# using a local copy due to connection issues with the above url
11+
<<<<<<<HEAD
1112
url<- paste0("~/projects/audiences", "/Emoji unicode characters for use on the web.html")
13+
=======
14+
url<- paste0(datadir, "/Emoji unicode characters for use on the web.html")
15+
>>>>>>>64cbec55ab53574be1346db0d0b7ae9cce410194
1216

1317
# get emoticons
1418
emoticons<-url %>%
1519
read_html() %>%
1620
html_nodes(xpath='/html/body/div[2]/div/div/table[1]') %>%
1721
html_table()
22+
<<<<<<<HEAD
1823
# emoticons <- data.frame(emoticons[[1]]$Native, emoticons[[1]]$Unicode, emoticons[[1]]$Bytes,
24+
=======
25+
# emoticons <- data.frame(emoticons[[1]]$Native, emoticons[[1]]$Unicode, emoticons[[1]]$Bytes,
26+
>>>>>>>64cbec55ab53574be1346db0d0b7ae9cce410194
1927
# emoticons[[1]]$Description, stringsAsFactors = FALSE)
2028
# names(emoticons) <- c("Native", "Unicode", "Bytes", "Description")
2129

@@ -24,7 +32,11 @@ addemoticons <- url %>%
2432
read_html() %>%
2533
html_nodes(xpath='/html/body/div[2]/div/div/table[6]') %>%
2634
html_table()
35+
<<<<<<<HEAD
2736
# addemoticons <- data.frame(addemoticons[[1]]$Native, addemoticons[[1]]$Bytes,
37+
=======
38+
# addemoticons <- data.frame(addemoticons[[1]]$Native, addemoticons[[1]]$Bytes,
39+
>>>>>>>64cbec55ab53574be1346db0d0b7ae9cce410194
2840
# addemoticons[[1]]$Description, stringsAsFactors = FALSE)
2941
# names(addemoticons) <- c("Native", "Bytes", "Description")
3042

@@ -33,7 +45,11 @@ dingbats <- url %>%
3345
read_html() %>%
3446
html_nodes(xpath='/html/body/div[2]/div/div/table[2]') %>%
3547
html_table()
48+
<<<<<<<HEAD
3649
# dingbats <- data.frame(dingbats[[1]]$Native, dingbats[[1]]$Bytes,
50+
=======
51+
# dingbats <- data.frame(dingbats[[1]]$Native, dingbats[[1]]$Bytes,
52+
>>>>>>>64cbec55ab53574be1346db0d0b7ae9cce410194
3753
# dingbats[[1]]$Description, stringsAsFactors = FALSE)
3854
# names(dingbats) <- c("Native", "Bytes", "Description")
3955

@@ -86,4 +102,8 @@ addothers <- url %>%
86102
alltogether<- bind_rows(list(emoticons[[1]], addemoticons[[1]], dingbats[[1]], transport[[1]],
87103
addtransport[[1]], enclosed[[1]], uncategorized[[1]], addothers[[1]]))
88104

105+
<<<<<<<HEAD
89106
names(alltogether) <- c("Native", "Apple", "Android", "Android2", "Symbola", "Twitter", "Unicode", "Bytes", "Description")
107+
=======
108+
names(alltogether) <- c("Native", "Apple", "Android", "Symbola", "Twitter", "Unicode", "Bytes", "Description")
109+
>>>>>>>64cbec55ab53574be1346db0d0b7ae9cce410194

config.toml

+5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ Paginate = 6
88
publishDir = "docs"
99
# RelativeURLs = true
1010
CanonifyURLs = true
11+
<<<<<<< HEAD
1112
ignoreFiles = [ "reports/_.*" ]
1213
# ignorefiles = [ "reports/*" ]
14+
=======
15+
# ignoreFiles = [ "reports/_.*" ]
16+
ignoreFiles = [ "reports/*" ]
17+
>>>>>>> 64cbec55ab53574be1346db0d0b7ae9cce410194
1318

1419

1520
[taxonomies]

docs/index.html

+3,286
Large diffs are not rendered by default.

fig_1.R

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ for(panel in 1:4){
6161
rowwise() %>%
6262
mutate(gamma=gamma+runif(1,0,0.0001))
6363

64+
<<<<<<<HEAD
6465
userlookup<- lookup_users(unique(bios_lda_gamma$document))
6566

6667
fig_dat<- left_join(bios_lda_gamma, userlookup %>%
@@ -70,6 +71,8 @@ for(panel in 1:4){
7071

7172
write_tsv(fig_dat, paste0("audiences/paper_data/fig1", letters[panel], ".txt"))
7273

74+
=======
75+
>>>>>>>64cbec55ab53574be1346db0d0b7ae9cce410194
7376
docs_order<-bios_lda_gamma %>%
7477
group_by(document) %>%
7578
arrange(topic, -gamma) %>%

paper_data/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Supplementary Data for the paper “Quantifying and contextualizing the impact of bioRxiv preprints through automated social media audience segmentation”
2+
3+
4+
## S1_Data.xlsx
5+
This file contains underlying data (Twitter IDs and the inferred audience sector breakdown for each user) for the audience segmentations of each of the 4 preprints displayed in Fig 1, with data for each preprint in a separate sheet.
6+
7+
## S2_Data.txt
8+
This file contains summary data and metadata (title, DOI, date posted, bioRxiv category, Altmetric’s estimated academic audience fraction, our estimated academic audience fraction, fractions of users exceeding the 2%, 5%, 10%, and 20% extremist network homophily thresholds, number of tweets analyzed, Altmetric score, number of citations in mainstream media, number of citations in the academic literature) for the 1,800 preprints analyzed. Information for each preprint is replicated across 12 rows (1 per audience sector), with additional columns indicating the topic number and top 30 keywords and fraction of audience associated with that topic. These data underlie Figs 1-4, Table 1, and Supplementary Figs S1-S6.

render_reports.R

+13
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ options(timeout = 600)
3434

3535
# set relative path for calling external files from within this script
3636
# datadir <- dirname(sys.frame(1)$ofile)
37+
<<<<<<<HEAD
3738
datadir<- paste0(getwd(), "/projects/audiences")
39+
=======
40+
datadir<- paste0(getwd(), "/audiences")
41+
>>>>>>>64cbec55ab53574be1346db0d0b7ae9cce410194
3842

3943
# Twitter oauth keys, email, other private data (e.g., hf_path)
4044
keys<- yaml.load_file(paste0(datadir, "/_config.yaml"))
@@ -45,7 +49,11 @@ outdir <- paste0(datadir, "/content/reports")
4549
dir.create(outdir, recursive=TRUE, showWarnings=FALSE)
4650

4751
# handles of training data
52+
<<<<<<<HEAD
4853
td_handles<- readRDS(paste0(datadir, "/training_data/training_data_handles.rds")) %>% pull(account)
54+
=======
55+
td_handles<- read.table("~/td_handles.txt") %>% pull
56+
>>>>>>>64cbec55ab53574be1346db0d0b7ae9cce410194
4957

5058
# biorxiv categories, excluding scicomm and clinical trials
5159
categories_trim<- c("animal-behavior-and-cognition",
@@ -877,10 +885,15 @@ if(!exists("high_followers")){
877885

878886
files_to_scan<- update_follower_files(datadir)
879887

888+
<<<<<<<HEAD
880889
readRDS_safe<- possibly(readRDS, otherwise= tibble())
881890

882891
high_followers<-files_to_scan %>%
883892
map_dfr(readRDS_safe) %>%
893+
=======
894+
high_followers<-files_to_scan %>%
895+
map_dfr(readRDS) %>%
896+
>>>>>>>64cbec55ab53574be1346db0d0b7ae9cce410194
884897
rowwise() %>%
885898
mutate(nfollowers= length(followers)) %>%
886899
arrange(desc(nfollowers)) %>%

report_template.rmd

+12
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,14 @@ plot_embedding_bars <- function(plotdat, docs_order){
540540
541541
p <- plotdat %>%
542542
mutate(topic=factor(topic, levels=unique(plotdat$topic))) %>%
543+
<<<<<<< HEAD
543544
ggplmutate(url=paste0("https://twitter.com/", document)) %>%
544545
ot(aes(x=document, y=gamma, fill=topic))+
545546
, customdata=url geom_bar(stat="identity", position="stack")+
547+
=======
548+
ggplot(aes(x=document, y=gamma, fill=topic))+
549+
geom_bar(stat="identity", position="stack")+
550+
>>>>>>> 64cbec55ab53574be1346db0d0b7ae9cce410194
546551
scale_fill_manual(values=cols)+
547552
scale_y_continuous(expand = c(0,0))+
548553
scale_x_discrete(position = "top")+
@@ -560,9 +565,16 @@ plot_embedding_bars <- function(plotdat, docs_order){
560565
yanchor = "bottom",
561566
x = 0, y=-1))
562567
# Clickable points link to profile URL using onRender: https://stackoverflow.com/questions/51681079
568+
<<<<<<< HEAD
563569
for(# for(i in 1:12){
564570
# ply$x$data[[i]]$customdata <- paste0("https://twitter.com/", docs_order$document)
565571
# #pp <- add_markers(pp, customdata = ~url)
572+
=======
573+
for(i in 1:12){
574+
ply$x$data[[i]]$customdata <- paste0("https://twitter.com/", docs_order$document)
575+
}
576+
#pp <- add_markers(pp, customdata = ~url)
577+
>>>>>>> 64cbec55ab53574be1346db0d0b7ae9cce410194
566578
plyout <- onRender(ply, "
567579
function(el, x) {
568580
el.on('plotly_click', function(d) {

themes/mondrian

Submodule mondrian deleted from f1e8075

themes/mondrian/LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 YOUR_NAME_HERE
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
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, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

themes/mondrian/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# hugo-mondrian-theme
2+
3+
Mondrian-like minimal theme for Hugo static site generator.
4+
5+
![](https://raw.githubusercontent.com/redraw/hugo-mondrian-theme/master/images/screenshot.gif)
6+
7+
8+
# Using
9+
10+
Copy the theme in `themes/mondrian` folder or add it as a git submodule,
11+
```bash
12+
$ git submodule add https://github.com/redraw/hugo-mondrian-theme.git themes/mondrian
13+
$ hugo server -t mondrian
14+
```
15+
16+
Colors are configurable per [content-type](https://gohugo.io/content-management/types/) and you can modify them in your `config.toml`, along with minor settings
17+
18+
```toml
19+
[params]
20+
showHeader = true
21+
showTags = true
22+
debug = false
23+
[params.colors]
24+
post = "orangered"
25+
page = "gold"
26+
sketch = "limegreen"
27+
```
28+
29+
If you want to test the `exampleSite`, run
30+
```bash
31+
$ cd themes/mondrian/exampleSite
32+
$ hugo server --themesDir ../..
33+
```
34+
35+
### Notes
36+
[Beerware](https://gitter.im/hugo-mondrian-theme) (?)

themes/mondrian/archetypes/default.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
+++
2+
+++
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
date: {{ .Date }}
4+
description: ""
5+
libs:
6+
js:
7+
- https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/p5.min.js
8+
---
9+
10+
<script>
11+
functionsetup(){
12+
varcanvas=createCanvas(windowWidth,windowHeight)
13+
canvas.parent('main')
14+
}
15+
16+
functiondraw(){}
17+
18+
functionwindowResized(){
19+
resizeCanvas(windowWidth,windowHeight);
20+
}
21+
</script>

themes/mondrian/data/default.toml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
showHeader = true
2+
showTags = true
3+
debug = false
4+
5+
[colors]
6+
post = "orangered"
7+
posts = "gold"
8+
page = "blue"
9+
sketch = "limegreen"
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# this setting is relevant for the theme demo on the Hugo Themes website
2+
ignoreFiles = [
3+
"content/posts/\\.*",
4+
"content/portfolio/\\.*",
5+
"content/product/\\.*",
6+
"content/en/\\.*",
7+
"content/fr/\\.*",
8+
"content/es/\\.*",
9+
"content/de/\\.*",
10+
"content/zh-tw/\\.*",
11+
"content/zh-cn/\\.*"
12+
]
13+
14+
baseURL = "http://example.org/"
15+
languageCode = "en"
16+
title = "hugo-mondrian-theme"
17+
theme = "mondrian"
18+
19+
[taxonomies]
20+
tag = "tags"
21+
22+
[params]
23+
showHeader = true
24+
showTags = true
25+
debug = false
26+
[params.colors]
27+
post = "orangered"
28+
posts = "gold"
29+
page = "blue"
30+
sketch = "limegreen"
31+
32+
[menu]
33+
[[menu.main]]
34+
name = "posts"
35+
url = "/post"
36+
weight = 1
37+
[[menu.main]]
38+
name = "sketches"
39+
url = "/sketch"
40+
weight = 2
41+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Single Page"
3+
date: 2019-03-04T23:37:33-03:00
4+
---
5+
6+
Single Page

0 commit comments

Comments
 (0)
close