How far are you from a lake? Living in Wisconsin, I wanted to know. There’s a lot of lakes in Wisconsin, but it was hard to visualize their distribution. Step 1) Download the high-resolution National Hydrography …
Blog
R Color (Colour) Table
I love the seemingly endless color options in R. However, I also waste a lot of time googling ‘r colors’. I finally decided I should just print off a color table for my office wall, …
Extracting polygon areas in R
Suppose I have a shapefile (lakes.shp) which consists of 5 polygons (Figure 1a). library(raster) lakes = shapefile(’lakes.shp’) plot(lakes, col=’dodgerblue’,main=’a) lakes’,lty=0) The shapefile is stored as a SpatialPolygonsDataFrame. The data underlying these polygons can be viewed …
readr 0.2
If your life as an ecologist is spent loading/writing .csv files in R, you should be using readr. Why? Well it’s a Hadley Wickham package for one. But really, it’s defaults make sense! read_csv: strings …
Find my weather station
Ever wonder how much it snowed last year, or the year before, or every year since 1950? Well, to find this data, you’ll first need to choose a weather station. As much as I like …
Oh god, umlauts!
Sweden has more lake data than most countries have lakes. However, they also have a 29 letter alphabet including ‘å’, ‘ä’ and ‘ö’. This results in lake names like Fräcksjön and Östra Helgtjärnen. Goal Combine …
Watercolor your lakes in R
All lakes are beautiful. Or at least when they’re coded in watercolor! For this you will need to install and load ggmap. I am a huge Hadley Wickham fan (obvs), but am not usually a …