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
// neuralnet settings | |
config.neuralnet = { | |
threshold_buy: 1, | |
threshold_sell: -1, | |
learning_rate: 0.02, | |
momentum: 0.5, | |
decay: 0.01, | |
stoploss_enabled: false, | |
stoploss_threshold: 0.85, | |
hodl_threshold: 0.90, |
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
Verifying my Blockstack ID is secured with the address 1EoroS9TcrFC3iWasWZULB7d9NycDRfoC5 https://explorer.blockstack.org/address/1EoroS9TcrFC3iWasWZULB7d9NycDRfoC5 |
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(httr); library(jsonlite) | |
# this gets a list of the available forms to later query for the records per form | |
baseurl <- "https://api.fulcrumapp.com" | |
path <- "/api/v2/forms.json" | |
XApiToken = "your-api-token" | |
form.list <- | |
GET( | |
url = paste0(baseurl, path), | |
add_headers(`X-ApiToken` = XApiToken), |
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
# load rgbif package | |
install.packages("rgbif"); library(rgbif) | |
# create a matrix with one line per query | |
country <- c('AU', 'US', 'DE') #iso2 country code | |
species <- c(2768885, 3020791) # alternativly get the gbif speciesKeys based on species names | |
sp <- c("Asparagus officinalis", "Prunus avium") | |
species <- sapply(sp, function(x) name_backbone(x, rank="plants")$speciesKey) | |
m <- rbind(cbind(country[1], species), cbind(country[2], species), cbind(country[3], species)) |
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
# API | |
## install packages | |
install.packages(c("httr", "jsonlite", "lubridate")) | |
library(httr) | |
library(jsonlite) | |
options(stringsAsFactors = FALSE) | |
## set variables to get all records per form id | |
baseurl <- "https://api.fulcrumapp.com" | |
path <- "/api/v2/" |
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
m qgis.utils import iface | |
layer = iface.activeLayer() | |
layer.startEditing() | |
compare_field_index = 2 | |
concat_field_index = 9 | |
new_field_index = 14 | |
feature_dict = {f.id(): f for f in layer.getFeatures()} | |
for f in feature_dict.values(): | |
if f[concat_field_index]: | |
new_field_text = f[concat_field_index] |
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
ha <- function(x){ | |
x$Lat<-(as.numeric(paste(x$Lat))) | |
x$Lon<-(as.numeric(paste(x$Lon))) | |
pre<-x[(x[,17]==0),] | |
post<-x[(x[,17]==1),] | |
if(nrow(pre)<2| nrow(post)<2){results<-paste("not enought records per phase")}else{ | |
early <- x[(which.min(x$Year)),] | |
e1 <- early[1,] | |
predist<-apply(pre, 1, function(x) distHaversine(as.numeric(e1[4:3]),as.numeric(x[4:3]), r=6378137)) | |
postdist<-apply(post, 1, function(x) distHaversine(as.numeric(e1[4:3]),as.numeric(x[4:3]), r=6378137)) |
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
disp.sp <- function(x) { | |
print(x) | |
x.genus <- unlist( strsplit(x," "))[1] | |
x.species <- unlist( strsplit(x," "))[2] | |
sp.test <- getURL(paste0("http://data.kew.org/sid/SidServlet?Clade=&Order=&Family=&APG=off&Genus=", x.genus,"&Species=",x.species,"&StorBehav=0&DsFlag=on")) | |
if (grepl("0 records found.", sp.test)) | |
{ | |
#return("Not_found") | |
results<-c(x,"Not_found") |
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
isgg<- function(x) { | |
species<-gsub(" ","+",x) | |
sp <- getURL(paste0("http://www.issg.org/database/species/search.asp?sts=sss&st=sss&fr=1&x=16&y=13&sn=", species,"&rn=&hci=-1&ei=-1&lang=EN")) | |
if (length(grep("No invasive species currently recorded",sp))) { | |
return("Not_found") | |
} else {return("Found")} | |
} |
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
get.eol.trait <- function(sp,trait) | |
{ | |
if (length(trait)==0) | |
{ | |
print("need trait") | |
stop() | |
} | |
library("reol"); library("traits"); library("dplyr") | |
pages<-DownloadSearchedTaxa(sp, to.file=F, MyKey=NULL, verbose=TRUE) | |
pages1<-as.numeric(gsub("eol","",colnames(as.data.frame(pages)))) |
NewerOlder