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
#' Description: Code using deSolve for some simple ecological ODE models | |
#' There are 3 examples, one is a simple LV Pred-Prey example with plots | |
#' The next is a Macarthur-Wilson model with plots of both the species curve and the equlibrium points | |
#' The last plot is a quick crack at putting stochasticity into the model by adding oscillations in I with t. | |
#' LV code is modified from a blog post here: http://assemblingnetwork.wordpress.com/2013/01/31/two-species-predator-prey-systems-with-r/ | |
#' Other additions are my own | |
#' | |
#' Author: Edmund Hart | |
#' Date: 3/28/2013 | |
#' E-mail: [email protected] |
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
##' Function readDFile | |
##' | |
##' Function readDFile | |
##' @param pathname the pathname of the directory containing the data to import | |
##' @return outData Output is a matrix of ion counts with rows as scantime and | |
##' columns as mass, and the respective values as labels | |
##' @export | |
readDFile<-function(pathname){ | |
filename<-file.path(pathname,'DATA.MS') |
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
# dependencies on fedora23: | |
# gdal-devel geos-devel proj-devel proj-nad proj-epsg | |
library(htmlwidgets) | |
library(raster) | |
library(leaflet) | |
# PATHS TO INPUT / OUTPUT FILES | |
projectPath = "/home/kreis/git/geotiff/" | |
#imgPath = paste(projectPath,"data/cea.tif", sep = "") |
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
# Here are a few methods for getting text from PDF files. Do read through | |
# the instructions carefully! NOte that this code is written for Windows 7, | |
# slight adjustments may be needed for other OSs | |
# Tell R what folder contains your 1000s of PDFs | |
dest <- "G:/somehere/with/many/PDFs" | |
# make a vector of PDF file names | |
myfiles <- list.files(path = dest, pattern = "pdf", full.names = TRUE) |
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
library(SPARQL) | |
library(ggplot2) | |
library(rworldmap) | |
wdqs <- "https://query.wikidata.org/bigdata/namespace/wdq/sparql" | |
query = "PREFIX wd: <http://www.wikidata.org/entity/> | |
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX p: <http://www.wikidata.org/prop/> | |
PREFIX v: <http://www.wikidata.org/prop/statement/> |
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
# Libraries | |
library(RMySQL) | |
# Connect to server | |
conn <- dbConnect(MySQL(), user="ab428", password="", | |
dbname="event_data", host="") | |
country <- "Turkey" | |
start.date <- "2013-05-15" | |
end.date <- "2013-06-15" |
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
# Copyright (c) 2013, Andrea Grandi and individual contributors. | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without modification, | |
# are permitted provided that the following conditions are met: | |
# | |
# 1) Redistributions of source code must retain the above copyright notice, | |
# this list of conditions and the following disclaimer. | |
# | |
# 2) Redistributions in binary form must reproduce the above copyright notice, |
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
ols <- lm(Temp ~ Solar.R, | |
data = airquality) | |
summary(ols) | |
str(ols) | |
plot(Temp ~ Solar.R, | |
data = airquality) | |
abline(ols) |
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
library(leaflet) | |
## OSM | |
leaflet() %>% | |
setView(-97.3606922, 32.7084083, zoom = 16) %>% | |
addTiles() | |
## OSM black-and-white |
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
#### Temporal Interpolation #################################################### | |
# Perform cell-wise linear interpolation between multiple raster layers, and | |
# extrapolation beyond the upper limit of input data. Output is saved in .tif | |
# format. | |
# | |
# Arguments | |
# s: a rasterStack containing the time slices to be interpolated | |
# | |
# xin: a numeric vector that indicates the times associated with layers in s (in | |
# the same order as the layers of s - see names(s)) |
NewerOlder