Skip to content

Instantly share code, notes, and snippets.

View tts's full-sized avatar

Tuija Sonkkila tts

View GitHub Profile
@tts
tts / change.R
Last active August 29, 2015 13:57
###########################################
#
# Plotting the volume change in some
# Aalto University degree programmes
# from 2014 to 2016
#
# See http://tuijasonkkila.fi/blog/?p=76
#
###########################################
[
{
"op": "core/column-addition",
"description": "Create column Pvm at index 1 based on column Ennusteen laatija using expression grel:value.replace(/[a-zA-Z\\s\\-]/,'')",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Pvm",
"columnInsertIndex": 1,
@tts
tts / gist:22b325266553e69eac19
Last active August 29, 2015 14:02
Altmetric badge demo
<html>
<head>
<script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script>
</head>
<body>
<p>
<a href="http://en.m.wikipedia.org/wiki/Altmetrics" target="_blank">Altmetrics</a> of <i>Intersubject consistency of cortical MEG signals during movie viewing</i> via Altmetric.com API rendered as a donut-shaped badge. Hovering over the badge reveals metrics, and clicking the badge leads to the Altmetric landing page.</p>
<div class='altmetric-embed'data-badge-type="donut" data-badge-popover='right' data-doi='10.1016/j.neuroimage.2014.02.004'></div>
</body>
</html>
@tts
tts / aalto_since2010.csv
Last active August 29, 2015 14:03
Some (alt)metrics of Aalto University publications since 2010 as a Shiny application
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"doi","school","ti","au","url","details_url","py","j9","so","tc","score","mendeley","connotea","citeulike","readers_count","cited_by_gplus_count","cited_by_fbwalls_count","cited_by_posts_count","cited_by_tweeters_count","cited_by_accounts_count","cited_by_feeds_count","cited_by_videos_count","cited_by_delicious_count","cited_by_rdts_count","cited_by_forum_count","cited_by_qs_count","cited_by_rh_count","cited_by_msm_count"
"10.1001/jama.2012.347","SCI","One vs Three Years of Adjuvant Imatinib for Operable Gastrointestinal Stromal Tumor A Randomized Trial","Joensuu, H; Eriksson, M; Hall, KS; Hartmann, JT; Pink, D; Schutte, J; Ramadori, G; Hohenberger, P; Duyster, J; Al-Batran, SE; Schlemmer, M; Bauer, S; Wardelmann, E; Sarlomo-Rikala, M; Nilsson, B; Sihto, H; Monge, OR; Bono, P; Kallio, R; Vehtari, A; Leinonen, M; Alvegard, T; Reichardt, P","http://dx.doi.org/10.1001/jama.2012.347","http://www.altmetric.com/details.php?citation_id=670011","2012","JAMA-J AM MED ASSOC","JAMA-JOURNAL OF THE AMERICAN MEDICAL ASSOCI
@tts
tts / aalto_since2010.csv
Last active August 29, 2015 14:03
Problem with ggvis in Shiny app (now solved see https://gist.github.com/tts/5df86b664b840c5927f9)
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"doi","school","ti","au","url","details_url","py","j9","so","tc","score","mendeley","connotea","citeulike","readers_count","cited_by_gplus_count","cited_by_fbwalls_count","cited_by_posts_count","cited_by_tweeters_count","cited_by_accounts_count","cited_by_feeds_count","cited_by_videos_count","cited_by_delicious_count","cited_by_rdts_count","cited_by_forum_count","cited_by_qs_count","cited_by_rh_count","cited_by_msm_count"
"10.1001/jama.2012.347","SCI","One vs Three Years of Adjuvant Imatinib for Operable Gastrointestinal Stromal Tumor A Randomized Trial","Joensuu, H; Eriksson, M; Hall, KS; Hartmann, JT; Pink, D; Schutte, J; Ramadori, G; Hohenberger, P; Duyster, J; Al-Batran, SE; Schlemmer, M; Bauer, S; Wardelmann, E; Sarlomo-Rikala, M; Nilsson, B; Sihto, H; Monge, OR; Bono, P; Kallio, R; Vehtari, A; Leinonen, M; Alvegard, T; Reichardt, P","http://dx.doi.org/10.1001/jama.2012.347","http://www.altmetric.com/details.php?citation_id=670011","2012","JAMA-J AM MED ASSOC","JAMA-JOURNAL OF THE AMERICAN MEDICAL ASSOCI
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"doi","school","ti","au","url","details_url","py","j9","so","tc","score","mendeley","connotea","citeulike","readers_count","cited_by_gplus_count","cited_by_fbwalls_count","cited_by_posts_count","cited_by_tweeters_count","cited_by_accounts_count","cited_by_feeds_count","cited_by_videos_count","cited_by_delicious_count","cited_by_rdts_count","cited_by_forum_count","cited_by_qs_count","cited_by_rh_count","cited_by_msm_count"
"10.1001/jama.2012.347","SCI","One vs Three Years of Adjuvant Imatinib for Operable Gastrointestinal Stromal Tumor A Randomized Trial","Joensuu, H; Eriksson, M; Hall, KS; Hartmann, JT; Pink, D; Schutte, J; Ramadori, G; Hohenberger, P; Duyster, J; Al-Batran, SE; Schlemmer, M; Bauer, S; Wardelmann, E; Sarlomo-Rikala, M; Nilsson, B; Sihto, H; Monge, OR; Bono, P; Kallio, R; Vehtari, A; Leinonen, M; Alvegard, T; Reichardt, P","http://dx.doi.org/10.1001/jama.2012.347","http://www.altmetric.com/details.php?citation_id=670011","2012","JAMA-J AM MED ASSOC","JAMA-JOURNAL OF THE AMERICAN MEDICAL ASSOCI
@tts
tts / aalto_doi_issn_07.csv
Last active August 29, 2015 14:03
Some (alt)metrics of Aalto University publications since 2007 as a Shiny web app https://ttso.shinyapps.io/AaltoAltmSince2007/
n di sn
6502 10.1371/journal.pone.0024926 1932-6203
7139 10.1371/journal.pone.0024408 1932-6203
10787 10.1371/journal.pone.0025415 1932-6203
@tts
tts / followlinkex.R
Last active August 29, 2015 14:06
Kilometrikisa results data
####################################
#
# Example of how to follow a link.
# The location (community) info of
# the teams is on a separate page.
#
# TODO: collect info of all teams
#
#####################################
@tts
tts / harvestTiming.R
Created September 26, 2014 08:34
Harvesting both with rbinding in the loop, and saving in a list
library(rvest)
resultslist <- vector("list", 2438)
dfAll <- data.frame(page = integer(0),
pos = integer(0),
team = character(0),
persons = integer(0),
kmpp = numeric(0),
kmsum = numeric(0),
@tts
tts / f_shortenurl.R
Last active August 29, 2015 14:08
A selection of Impactstory metrics of the experimental Aalto University profile page of research outputs
# Code by Andy Teucher
#
# https://github.com/ateucher/crd_rare_bird_bot/blob/master/fun.R
shorten <- function(url, token) {
stop_for_status(GET(url))
res <- GET("https://api-ssl.bitly.com/v3/shorten",
query = list(access_token=token, longUrl=url))