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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# Clear workspace | |
rm(list=ls()) | |
# load libraries | |
library(rgeos) | |
library(maptools) | |
# Set seed | |
set.seed(1234) |
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
# Compare CS, costDist and commuteDist | |
# Clear workspace | |
rm(list=ls()) | |
# Load libraries | |
library(gdistance) | |
library(scales) | |
library(gstat) |
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
###################### | |
## Web scraping ## | |
###################### | |
# Clear workspace | |
rm(list=ls()) | |
# Load libraries | |
require(RCurl) | |
require(XML) |
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
# Clear workspace | |
rm(list=ls()) | |
# Load libraries | |
require(rasterVis) | |
require(dismo) | |
require(GISTools) | |
require(spdep) | |
require(RColorBrewer) |
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
#################################### | |
# Run zonal statistics in parallel # | |
#################################### | |
# Clear workspace | |
rm(list=ls()) | |
# Libraries | |
library(raster) | |
library(gstat) |
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
######################################## | |
#### Getting started #### | |
######################################## | |
# Make a place holder for the cs_run.exe path | |
CS_exe <- 'C:/"Program Files"/Circuitscape/cs_run.exe' # Don't forget the "Program Files" problem | |
# We want to run one of the CS examples found in /examples/, first we need to fix the .ini file | |
# We first read in the .ini file and then we change the arguments | |
Example_lines <- readLines("C:/Program Files/Circuitscape/examples/eight_neighbor_example.ini") |
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
###################################### | |
#### Example Run #### | |
###################################### | |
# Clear workspace | |
rm(list=ls()) | |
# load raster library | |
library(raster) | |
# Make a place holder for the cs_run.exe path |