This file contains hidden or 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
vif_func<-function(in_frame,thresh=10,trace=T,wts=NULL,...){ | |
library(fmsb) | |
if(any(!'data.frame' %in% class(in_frame))) in_frame<-data.frame(in_frame) | |
if(is.null(wts)) | |
wts <- rep(1, ncol(in_frame)) | |
if(!is.null(wts)) | |
if(length(wts)!=ncol(in_frame)) stop('length of weights must equal number of variables') |
This file contains hidden or 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
catch.fun<-function(dows,fish.str,net.type='Trap',trace=T,clean=F){ | |
require(XML) | |
strt<-Sys.time() | |
#create object for output | |
fish.out<-data.frame(expand.grid(dows,fish.str),NA,NA) | |
names(fish.out)<-c('dows','fish','fish.val','result') |
This file contains hidden or 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
#import relevant packages | |
library(gstat) | |
library(sp) | |
library(nlme) | |
#create simulated data, lat and lon from uniformly distributed variable, exp1 and exp2 from random normal | |
set.seed(2) | |
samp.sz<-400 | |
lat<-runif(samp.sz,-4,4) | |
lon<-runif(samp.sz,-4,4) |
This file contains hidden or 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
#install the packages | |
install.packages('XML') | |
require(XML) | |
#get raw html for Lake Minnetonka | |
html.raw<-htmlTreeParse( | |
'http://www.dnr.state.mn.us/lakefind/showreport.html?downum=27013300', | |
useInternalNodes=T | |
) |
NewerOlder