Comments (6)
correlation matrix of 69 terrestrial env vars (on left), plot of one pair (percent forested with 10 cell radius vs 100 cell radius) on the right.
from regional_sdm.
That's a pretty correlation diagram--how does one make it?
I used an r2 of 0.64, for a correlation value of 0.8.
from regional_sdm.
Excellent. Thank you. Do you have code for that? Didn't you use clustering of some sort?
The package qtlcharts:
http://kbroman.org/qtlcharts/assets/vignettes/userGuide.html
from regional_sdm.
from regional_sdm.
It was attached to the bottom of an aquatic variable prep script--that's why I couldn't find it. The igraph
package did the clustering.
# run correlation analysis
#correlationtree <- varclus(data.matrix(MoBI_FlowEnvVar_Update[3:173]), similarity="spear")
correlationtree <- varclus(data.matrix(MoBI_FlowEnvVar_Update[c(80:82,105:110,121,174:178)]), similarity="spear")
# plot the data
#pdf("file.pdf",width=24,height=12)
plot(correlationtree, cex=0.6)
abline(h=0.1, col="blue")
abline(h=0.2, col="red")
#dev.off()
# prevent duplicated pairs
var.corelation <- correlationtree$sim*lower.tri(correlationtree$sim)
check.corelation <- which(var.corelation>0.64, arr.ind=TRUE)
graph.cor <- graph.data.frame(check.corelation, directed = FALSE)
groups.cor <- split(unique(as.vector(check.corelation)), clusters(graph.cor)$membership)
a <- lapply(groups.cor,FUN=function(list.cor){rownames(var.corelation)[list.cor]})
correlated_groups <- do.call("rbind", lapply(a, data.frame))
correlated_groups$group <- rownames(correlated_groups)
correlated_groups$group <- gsub("\\..*","",correlated_groups$group) #use to join up with the lkupenvvars table
rm(a, var.corelation, check.corelation, groups.cor, graph.cor)
# sqlite loading
db_aqua_lotic <- dbConnect(SQLite(),"MoBI_Aquatic_EnvVars.sqlite")
dbWriteTable(db_aqua_lotic, "envvar_lotic", MoBI_FlowEnvVar_Update)
dbDisconnect(db_aqua_lotic)
# envvar descriptions
envvars <- colnames(MoBI_FlowEnvVar)
ev_desc <- as.data.frame(envvars)
for(i in 1:length(ev_desc$envvars)){
ev_desc$mean <- mean(get(MoBI_FlowEnvVar)$ev_desc$envvars[i])
#get(paste('r',i,collapse='',sep=''))$speed
}
ev_desc <- lapply(MoBI_FlowEnvVar[25:262], function(x) rbind( mean = mean(x, na.rm=TRUE) ,
sd = sd(x, na.rm=TRUE) ,
median = median(x, na.rm=TRUE) ,
minimum = min(x, na.rm=TRUE) ,
maximum = max(x, na.rm=TRUE) ,
s.size = length(x) ) )
from regional_sdm.
Thanks!
from regional_sdm.
Related Issues (20)
- encoding error HOT 10
- subset data for pplots HOT 2
- Writing the Aquatic metadata map is really slow for large areas under tmap HOT 3
- mtry: reset to valid range HOT 3
- add test for GDAL on the Path HOT 1
- camelCase variables in `background_CONUS.sqlite` causing dropped variables in metadata in 3_createModel.R HOT 2
- AquaGroup: incorrect cutoff specified HOT 10
- AquaGroup: sampsize larger than class HOT 1
- Aquatics: query to select EnvVars for predict is grabbing all EnvVars
- df.in2 not found HOT 4
- timestamp in name in output files
- area -based subsampling
- handle nulls AND blanks in correlated vars table
- group and clean polys in prep
- rework parallel sections
- stars package integrating for faster raster processing HOT 2
- Discussion: Adding embedded metadata into the tiff files HOT 1
- xgb doesn't like model saving within RData file
- current version in terrestrial doesn't handle raster subfolders when cropping
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from regional_sdm.