Skip to content

Instantly share code, notes, and snippets.

Tuija Sonkkila tts

Block or report user

Report or block tts

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View hkitrees_viz.R
library(tidyverse)
library(sf)
# Data from hri.fi
districts <- st_read("PKS_Kartta_Rajat_KML2011/PKS_suuralue.kml")
hki <- districts %>%
filter(Name %in% c("Eteläinen", "Itäinen","Läntinen","Kaakkoinen",
"Keskinen","Pohjoinen","Koillinen")) %>%
mutate(Name_en = case_when(
@tts
tts / energy.R
Last active Jan 20, 2019
Line graph on energy production in district heating of the Helsinki capital area
View energy.R
library(tidyverse)
library(readxl)
library(httr)
#-------------------------------------------------------------
# hri.fi
#
# Pääkaupunkiseudun kaukolämmön tuotannon energialähteet (GWh)
#-------------------------------------------------------------
@tts
tts / addMissingYears.vb
Last active Jul 11, 2017
Transform Pure activities data by filling in rows with missing year
View addMissingYears.vb
Public Sub addMissingYears()
Dim readFrom As Long 'Row we read from
Dim writeTo As Long 'Row we write to
Dim allRows As Long 'Row count to loop over
Dim thisC As Long
Dim thisD As Long
Dim sheetFrom As Worksheet 'Sheet where we read from
Dim sheetTo As Worksheet 'Sheet where we write to
@tts
tts / pure2powerbi.R
Last active Jul 10, 2017
Transform Pure activities data exported as Excel to be imported into Power BI for reporting
View pure2powerbi.R
# `dataset` holds the input data for this script
library(dplyr)
names(dataset) <- c("Type", "Unit", "Start", "End")
dataset$Unit <- iconv(dataset$Unit, from = "WINDOWS-1252", to = "UTF-8")
# We need to expand those rows where Start and End span more than one year,
# e.g. 2010-2012 into 2010, 2011, 2012
to_expand <- dataset %>%
View changes_metrics_small_multiples.R
library(dplyr)
library(tidyr)
library(ggplot2)
library(gridExtra)
library(grid)
data20162017 <- read.csv("toshiny_altm_2016_2017.csv", stringsAsFactors = FALSE)
data20162017 <- data20162017 %>%
mutate(gap_cites = Citations2017 - Citations,
@tts
tts / draw_grid.R
Created Jun 2, 2017
Changes from 2016 to 2017 in citations and altmetrics of some Aalto University publications by School
View draw_grid.R
# https://blog.dominodatalab.com/visualizing-homeownership-in-the-us-using-small-multiples-and-r/
opts <- theme(
panel.background = element_rect(fill="white"),
panel.border = element_rect(colour="black", fill=NA),
axis.line = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.text = element_text(colour="gray25", size=15, angle=90, hjust=1),
axis.title = element_blank(),
@tts
tts / oadoidata_to_flare_json.R
Created Nov 25, 2016
Some metadata and URL of full-text OA articles by source type returned by oadoi.org
View oadoidata_to_flare_json.R
library(purrr)
library(tidyr)
library(dplyr)
library(jsonlite)
# Data queried via oadoi.org API with the roadoi package. Title from local CRIS, joined with DOI.
# See https://users.aalto.fi/~sonkkila/oadoi.html
data <- read.csv(file = "repo_and_oadoi.csv", stringsAsFactors = F)
oa <- data[!is.na(data$free_fulltext_url), c("title", "evidence", "free_fulltext_url")]
@tts
tts / app.R
Last active Nov 21, 2016
Shiny web app on the CRIS project emails
View app.R
library(shiny)
library(highcharter)
library(dygraphs)
library(xts)
library(dplyr)
shinyApp(
ui = fluidPage(
fluidRow(
column(12,
@tts
tts / springerLODconf.sq
Last active Nov 10, 2016
SPARQL query for searching Springer Computer Science conferences not indexed by Scopus (see http://lod.springer.com/wiki/bin/view/Linked+Open+Data/About)
View springerLODconf.sq
PREFIX spr-p: <http://lod.springer.com/data/ontology/property/>
PREFIX spr-c: <http://lod.springer.com/data/ontology/class/>
SELECT ?volume ?title ?subtitle ?acronym ?isbn ?eisbn ?scopus ?sdate WHERE {
?volume spr-p:hasConference ?conf ;
spr-p:isIndexedByScopus ?scopus ;
spr-p:title ?title ;
spr-p:subtitle ?subtitle ;
spr-p:bookSeriesAcronym ?acronym ;
spr-p:ISBN ?isbn ;
@tts
tts / query.R
Created Jul 8, 2016
Collect works and bio via ORCID Public API
View query.R
# Query ACRIS on ORCID IDs. Based on these, fetch works and bio via ORCID Public API
#
# SQL query in Pure and save in CSV: SELECT firstname, lastname, orcid FROM PERSON WHERE orcid IS NOT NULL
# Change character set: iconv -f ISO-8859-1 -t UTF-8 orcidinpure.csv > orcidinpure_utf8.csv
#
# Tuija Sonkkila 7.7.2016
library(rorcid)
You can’t perform that action at this time.