Skip to content

Instantly share code, notes, and snippets.

View jlehtoma's full-sized avatar

Joona Lehtomäki jlehtoma

  • Helsinki
View GitHub Profile
Top 3.94%
Amphibians Birds Freshwater fish Mammals Plants Reptiles
Amphibians 1.00000000 0.10976019 0.07313933 0.1665817 0.14020769 0.1532886
Birds 0.10976019 1.00000000 0.08673298 0.1280185 0.13937816 0.1598971
Freshwater fish 0.07313933 0.08673298 1.00000000 0.0691273 0.08017331 0.0798534
Mammals 0.16658172 0.12801850 0.06912730 1.0000000 0.18084051 0.1759870
Plants 0.14020769 0.13937816 0.08017331 0.1808405 1.00000000 0.1862069
Reptiles 0.15328863 0.15989709 0.07985340 0.1759870 0.18620690 1.0000000
library(rvest)
library(stringr)
library(tidyverse)
base_url <- "http://www.metsakartat.fi/"
get_zip <- function(x) {
message("Downloading ", x, "...")
download.file(x, basename(x), "internal")
return(invisible(TRUE))
@jlehtoma
jlehtoma / correlation_pairs.R
Created March 27, 2017 15:51
Plot correaltion pairs
# panel.smooth function is built in.
# panel_cor puts correlation in upper panels, size proportional to correlation
panel_cor <- function(x, y, digits=2, prefix="", cex.cor, ...) {
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r <- abs(cor(x, y))
txt <- format(c(r, 0.123456789), digits = digits)[1]
txt <- paste(prefix, txt, sep = "")
if (missing(cex.cor)) cex.cor <- 0.8/strwidth(txt)
text(0.5, 0.5, txt, cex = cex.cor * r)
This file has been truncated, but you can view the full file.
-- Start of simulation at: 13:18:36 --
demand file used: demand.in1
region file used: region1.fil.asc
number of cover types: 22
number of regions: 1
number of factors in 1 equation: 17
total number of factors: 23
number of demand types: 5
@jlehtoma
jlehtoma / wms_proto.R
Created November 13, 2011 20:01
Prototype for accessing WMS from R
# Author: Joona Lehtomäki <joona.lehtomaki@gmail.com>
# Updated: 13.11.2011
# Version: 0.0.1
if (!require("rgdal")) {
install.packages("rgdal")
}
if (!require("raster")) {
install.packages("raster")
@jlehtoma
jlehtoma / wfs_tests.R
Created October 28, 2016 08:59
Testing different variants of accessing WFS data in R
library(gdalUtils)
library(rgdal)
library(rwfs)
library(sp)
dsn_espoo <- "WFS:http://kartat.espoo.fi/TeklaOgcWeb/WFS.ashx?service=WFS&REQUEST=GetCapabilities&maxFeatures=100000"
dsn_vantaa <- "WFS:http://gis.vantaa.fi/geoserver/wfs"
# Variant 1 ----------------------------------------------------------------
@jlehtoma
jlehtoma / ceph.md
Last active October 14, 2016 11:55
Mount Ceph datablock on SURFsara HPC Cloud VM

Mount the datadisk in the VM

In this section we show you how you can start using the new disk.

  1. On the UI, from the menu at the left pane select the Virtual Machines page under Virtual Resources. Create a new VM by selecting the Template you created in the previous step.
  2. Once the VM is in RUNNING state, ssh as root to the machine using your SSH-key.
  3. Run fdisk -l and see that your new datablock is there (Disk /dev/vdb: 10.5 GB).
  4. Mount the datadisk in the VM:
3. Please select the workshop you are attending. Events are listed in chronological order.
4. Will this be your first time attending a Data Carpentry workshop (as a learner)?
5. Which of the following describes your current status?
Undergraduate student
Graduate Student
Post-doc
Faculty
Industry
GNoTPA-expansion
├── 001_GNoTPA_caz_noadmu_2000_ecor
├── 002_GNoTPA_abf_noadmu_2000_ecor
├── 101_GNoTPA_caz_noadmu_2040_ecor
├── 102_GNoTPA_abf_noadmu_2040_ecor
├── GNoTPA_output
│ ├── 001_caz_noadmu_2000_ecor
│ │ ├── 001_caz_noadmu_2000_ecor.CAZ_MDE.curves.oct.txt
│ │ ├── 001_caz_noadmu_2000_ecor.CAZ_MDE.curves.txt
│ │ ├── 001_caz_noadmu_2000_ecor.CAZ_MDE.features_info.txt
### Keybase proof
I hereby claim:
* I am jlehtoma on github.
* I am jlehtoma (https://keybase.io/jlehtoma) on keybase.
* I have a public key whose fingerprint is 724B 39EE 612B B0A1 E518 5087 44DF 9D93 ED41 6438
To claim this, I am signing this object: