This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
sparql_endpoint <- "http://dbpedia.org/sparql" | |
# Query example from https://medium.com/virtuoso-blog/dbpedia-basic-queries-bc1ac172cc09 | |
q <- " | |
SELECT ?athlete ?cityName | |
WHERE | |
{ | |
?athlete rdfs:label 'Cristiano Ronaldo'@en ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://raw.githubusercontent.com/gkaramanis/tidytuesday/master/2021/2021-week37/billboard.R | |
# https://twitter.com/ttso/status/1442485258172043268 | |
billb_feat <- billb_feat %>% | |
mutate( | |
subgenre = case_when( | |
str_detect(spotify_genre, "rock") ~ "1", | |
str_detect(spotify_genre, "folk") ~ "2", | |
str_detect(spotify_genre, "pop") ~ "3", | |
str_detect(spotify_genre, "jazz") ~ "4", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(stringr) | |
library(tidyverse) | |
#--------------------------------------------------------------- | |
# https://twitter.com/nealhaddaway/status/1362512900716433409 | |
# | |
# His example query | |
#-------------------------------------------------------------- | |
q <- "((arable OR agricult* OR farm* OR crop* OR cultivat* OR field*) AND | |
(plough* OR plow* OR till* OR 'direct drill*' OR fertili* OR biosolid* OR |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(readxl) | |
library(tmaptools) | |
library(maps) | |
library(sf) | |
url <- "https://altmetric.figshare.com/ndownloader/files/20202618" | |
temp <- tempfile() | |
download.file(url, temp) | |
data <- read_excel(temp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(readxl) | |
library(httr) | |
#------------------------------------------------------------- | |
# hri.fi | |
# | |
# Pääkaupunkiseudun kaukolämmön tuotannon energialähteet (GWh) | |
#------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `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 %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
NewerOlder