Skip to content

Instantly share code, notes, and snippets.

View gedankenstuecke's full-sized avatar
🥽
Doing Research

Bastian Greshake Tzovaras gedankenstuecke

🥽
Doing Research
View GitHub Profile
@gedankenstuecke
gedankenstuecke / rayshader_argentina.R
Created March 7, 2024 19:52
Making 3D population maps of Argentina
# ADAPTED FROM:
# - Spencer Schien's rayshader+kontur tutorial: https://justjensen.co/making-population-density-maps-with-rayrender-in-r/
# - Erik Jensen's adaptation of it: https://justjensen.co/making-population-density-maps-with-rayrender-in-r/
# INSTALL NECESSARY PACKAGES
install.packages("sf")
install.packages("rayrender")
install.packages("rayshader")
install.packages("R.utils")
@gedankenstuecke
gedankenstuecke / main.js
Last active January 4, 2019 19:55
javascript used for the personalapi display
$(function(){
var json_url = $('#json_url').attr('href');
$.get(json_url, function(data){
if(data.location.tz){
var local_time = new Date( new Date().getTime() + data.location.tz_offset * 1000).toUTCString().replace( / GMT$/, "" ).substring(17,22);
$("#local_time").html(local_time);
$("#time_zone").html(data.location.tz);
$("#time_info").removeClass('invisible');
};
@gedankenstuecke
gedankenstuecke / footer.html
Last active January 4, 2019 19:58
Footer for tzovar.as
{'created': '2018-01-23T14:05:23.521397Z',
'project_member_id': '92469662',
'message_permission': True,
'sources_shared': [],
'username': 'gedankenstuecke',
'data': [{'id': 36938,
'basename': 'example_data1.txt',
'created': '2018-04-03T04:28:53.193902Z',
'download_url': 'https://example.com',
'metadata': {'tags': ['example', 'text', 'demo'],
sys.stdout.write("\r[%s%s]%d%s"%('.'*d,
''*(50-d),
d*2,'%'))
month downloads days_with_data
01 9257598 31
02 9854264 27
03 12990139 30
04 8911780 21
05 13959687 30
06 14123204 30
07 18410282 31
08 17418110 30
09 15235240 30
# get new directory for this
mkdir celery
cd celery
# create environment w/ py2.7
conda create -n celery python=2.7
# switch to environment
source activate celery
library(ggplot2)
agree <- rnorm(15000, 3.72, 0.68)
concs <- rnorm(15000, 3.63, 0.72)
extra <- rnorm(15000, 3.27, 0.89)
neuro <- rnorm(15000, 3.21, 0.84)
openn <- rnorm(15000, 3.93, 0.67)
big5 <- data.frame(agreeableness=agree,
conscientiousness=concs,
DOI is_open_access best_open_access_host
10.1038/001009a0 False NA
10.1038/001023a0 False NA
10.1038/001043a0 False NA
10.1038/001085b0 False NA
10.1038/001112b0 False NA
10.1038/001189c0 False NA
10.1038/001213a0 False NA
10.1038/001308a0 False NA
10.1038/001315c0 False NA
@gedankenstuecke
gedankenstuecke / class2tree_workaround.R
Last active May 25, 2017 07:44
class2tree workaround
library(taxize)
library(reshape2)
### stuff starts here
#### remove the rank filter from the clustering method
class2tree_helper_no_filter <- function(x){
#x <- x[!x$rank == "no rank", ]
df <- x[-nrow(x), 'id']