Skip to content

Instantly share code, notes, and snippets.

View tts's full-sized avatar

Tuija Sonkkila tts

View GitHub Profile
@tts
tts / global.R
Last active January 16, 2018 02:02
Shiny application on visualizing text-mining outputs of REF2014 impact case studies
library(shiny)
library(shinydashboard)
library(dplyr)
library(tidyr)
library(ggvis)
library(DT)
library(d3heatmap)
load("ref2014impact.Rda")
library(httr)
alchemy_url <- "http://access.alchemyapi.com/"
call <- "calls/text/TextGetRankedConcepts"
api_key <- "[your API key here]"
text <- "Indeed the Environment Agency inform us that these guidelines have been used as the basis of several hundred appraisals for the ongoing WaterIndustry Price Review process 10"
# The following doesn't work. 'Status: 404, Content-Type: <unknown>'
#
@tts
tts / bib.R
Last active August 29, 2015 14:20
Harvesting some Aalto University BibTex data to be shown with Bibtexbrowser
library(rvest)
url <- "http://math.aalto.fi/en/current/publications/articles/"
linknodes <- url %>%
html %>%
html_nodes(xpath = "//a[starts-with(@href,'/en/current/publications/bibtex')]")
ids <- linknodes %>%
html_attr("href") %>%
@tts
tts / kulosaari.R
Last active August 29, 2015 14:17
Helsinki roadmap and 3D buildings on a georeferenced map of Kulosaari
##########################################################
#
# Helsinki roadmap and 3D buildings rendered
# on a georeferenced map of Kulosaari from 1917
# as an intearctive leaflet map.
#
# See http://tuijasonkkila.fi/blog/2015/03/2015-on-1917/
#
# Map of Kulosaari
# Helsingin kaupungin tietokeskus;
@tts
tts / global.R
Last active February 18, 2022 05:28
Finnish Breeding Bird Atlas (1-2) open data as a Shiny web app
library(shiny)
library(leaflet)
library(shinythemes)
library(dplyr)
# See http://tuijasonkkila.fi/blog/2015/03/birds-on-a-map/
# http://atlas3.lintuatlas.fi/taustaa/kaytto
#
# linnut <- read.table("lajit.csv", sep = ",", stringsAsFactors = F, quote = "")
@tts
tts / aaltowp.R
Last active August 29, 2015 14:16
# Tuija Sonkkila 3.3.2015
#
# Aalto University articles cited in Wikipedia with the DOI.
# This code makes node and node attribute files for a network graph visualization.
#
# Wikipedia data CC0:
# Halfaker, Aaron; Taraborelli, Dario (2015): Scholarly article citations in Wikipedia. figshare.
# http://dx.doi.org/10.6084/m9.figshare.1299540
# Retrieved 15:17, Mar 02, 2015 (GMT)
#
@tts
tts / wcited.R
Last active August 29, 2015 14:15
Aalto University PubMed articles cited in Wikipedia
# Tuija Sonkkila 8.2.2015
# Aalto University PubMed articles cited in Wikipedia, and the number of page watchers (if given)
#
# Dataset (CC0):
# Halfaker, Aaron; Taraborelli, Dario (2015): Scholarly article citations in Wikipedia. figshare.
# http://dx.doi.org/10.6084/m9.figshare.1299540
# Retrieved 09:35, Feb 08, 2015 (GMT)
library(dplyr)
library(jsonlite)
@tts
tts / f_shortenurl.R
Last active August 29, 2015 14:14
Twitterbot for new items in Aaltodoc, Aalto University document repository.
####################################################################
#
# Code by Andy Teucher
#
# https://github.com/ateucher/crd_rare_bird_bot/blob/master/fun.R
#
####################################################################
shorten <- function(url, bitlytoken) {
stop_for_status(GET(url))
@tts
tts / global.R
Last active August 29, 2015 14:12
Snow depth data by FMI as a Shiny application
###################################################################
#
# Data by Finnish Meteorological Institute
# http://en.ilmatieteenlaitos.fi/open-data-licence
#
# rmi R package Jussi Jousimo et al. (C) 2014
# https://github.com/rOpenGov/fmi
#
# Blog post http://tuijasonkkila.fi/blog/2015/01/snow-in-lapland/
#
@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))