Publications by Kay Cichini
Taxonomy with R: Exploring the Taxize-Package
First off, I’d really like to give a shout-out to the brave people who have created and maintain this great package – the fame is yours!So, while exploring the capabilities of the package some issues with the ITIS-Server arose and with large datasets things weren’t working out quite well for me.I then switched to the NCBI API and saw that t...
994 sym R (1922 sym/1 pcs) 2 img
Convert OpenStreetMap Objects to KML with R
A quick geo-tip:With the osmar and maptools package you can easily pull an OpenStreetMap object and convert it to KML, like below (thanks to adibender helping out on SO). I found the relation ID by googling for it (www.google.at/search?q=openstreetmap+relation+innsbruck).# get OSM data library(osmar) library(maptools) innsbruck <- ge...
680 sym R (367 sym/1 pcs)
Download Files from Dropbox Programmatically with R
Here is a usefull snippet that I stole from qdap::url_dl to download files from my Dropbox to the working directory.Argument x is the document name and d the document key. dl_from_dropbox <- function(x, key) { require(RCurl) bin <- getBinaryURL(paste0("https://dl.dropboxusercontent.com/s...
640 sym R (604 sym/1 pcs)
Tweaking Movie Subtitles with R
I use R to fix subtitles that are not in sync with my movies. For the example below the subs were showing too early – so I added some time to each sequence in the srt file. For simplicity I used exactly 1 second in the below example.You’ll see that I use my function dl_from_dropbox(), on which I wrote a post previously, to get the...
754 sym R (1881 sym/1 pcs) 2 img
Download File from Google Drive/Docs Programmatically with R
Following up my lattest posting on how to download files from the cloud with R..dl_from_GoogleD <- function(output, key, format) { ## Arguments: ## output = output file name ## key = Google document key ## format = output format (pdf, rtf, doc, txt..) ## Note: File must be shareable! require(RCurl) ...
488 sym R (882 sym/1 pcs)
Programmatically Download CORINE Land Cover Seamless Vector Data with R
Thanks to a helpful SO-Answer I was able to download all CLC vector data (43 zip-files) programmatically:require(XML) path_to_files <- "D:/GIS_DataBase/CorineLC/Seamless" dir.create(path_to_files) setwd(path_to_files) doc <- htmlParse("http://www.eea.europa.eu/data-and-maps/data/clc-2006-vector-data-version-2") urls <- xpathSApply(doc,'//*/a[co...
501 sym R (780 sym/1 pcs) 2 img
Creating a QGIS-Style (qml-file) with an R-Script
How to get from a txt-file with short names and labels to a QGIS-Style (qml-file)? I used the below R-script to create a style for this legend table where I copy-pasted the parts I needed to a txt-file, like for the WRB-FULL (WRB-FULL: Full soil code of the STU from the World Reference Base for Soil Resources). The vector data to whic...
964 sym 2 img
R Quick Tip: Shutdown Windows after Script Has Finished
Quite often I have long procedures running and want to do this over night. However, my computer would still be running all night after the script has finished. This is easily circumvented by the following lines that I put at the end of such a script:# set working dir # setwd("C:/Users/Kay/Desktop") # long procedure: for(i in 1:1e+5) ...
658 sym R (376 sym/1 pcs)
Use R to Bulk-Download Digital Elevation Data with 1" Resolution
Here’s a little r-script to convenientely download high quality digital elevation data, i.e. for the Alps, from HERE:require(XML) dir.create("D:/GIS_DataBase/DEM/") setwd("D:/GIS_DataBase/DEM/") doc <- htmlParse("http://www.viewfinderpanoramas.org/dem3.html#alps") urls <- paste0("http://www.viewfinderpanoramas.org", xpathSApply(do...
622 sym R (510 sym/1 pcs)
R GIS: Terrain Analysis for Polygons as Simple as it Gets!
library(rgdal) library(raster) alt <- getData('alt', country = "AT") gadm <- getData('GADM', country = "AT", level = 2) gadm_sub <- gadm[sample(1:length(gadm), 5), ] plot(alt) plot(gadm_sub, add=T) asp <- terrain(alt, opt = "aspect", unit = "degrees", df = F) slo <- terrain(alt, opt = "slope", unit = "degrees", df = F) > extract(slo, gadm_sub...
396 sym R (634 sym/1 pcs) 2 img