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
# This is the server logic for a Shiny web application. | |
# You can find out more about building applications with Shiny here: | |
# | |
# http://shiny.rstudio.com | |
# | |
library(shiny) | |
shinyServer(function(input, output) { |
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
#distance 846 tours | |
distTow<-dist(TowSpdf@coords,method="euclidean") | |
matdistTow<-as.matrix(distTow) | |
matdistTow[matdistTow==0]<-NA | |
min(matdistTow,na.rm=TRUE)/1000 | |
max(matdistTow,na.rm=TRUE)/1000 | |
mean(matdistTow,na.rm=TRUE)/1000 |
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
model closest_to | |
global { | |
int nb_agents_min <- 50; | |
int nb_agents_max <- 5000; | |
bool agent1_use_geom <- false; | |
bool agent2_use_geom <- false; | |
geometry agent1_geom <- circle(3); | |
geometry agent2_geom <- circle(5); | |
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
/** | |
* closest_to | |
* Author: Robin Cura | |
* Description: | |
*/ | |
model closest_to | |
global { |
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
model si | |
// A simple infection spreading model | |
global { | |
int number_people <- 300; // The init number of people | |
int number_I <- 1 ; // The init number of infected | |
float infection_rate <- 0.1 ; // The infection rate | |
float infection_distance <- 5.0 ; // infection distance (in meters) | |
int immune_step <- 30 ; // number of steps before becoming immune after infection | |
int end_immunity_step <-50; // number of steps before not being immune anymore |
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
diff --git a/msi.gama.application/gama1.7.Eclipse3_8_2.product b/msi.gama.application/gama1.7.Eclipse3_8_2.product | |
index b97e304..7649748 100644 | |
--- a/msi.gama.application/gama1.7.Eclipse3_8_2.product | |
+++ b/msi.gama.application/gama1.7.Eclipse3_8_2.product | |
@@ -268,6 +268,10 @@ openFile | |
<feature id="org.eclipse.ecf.core.ssl.feature"/> | |
<feature id="org.eclipse.ecf.filetransfer.ssl.feature"/> | |
<feature id="org.eclipse.e4.rcp"/> | |
+ <feature id="ummisco.gama.feature.models"/> | |
+ <feature id="ummisco.gama.feature.dependencies"/> |
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
voteNames <- paste("Vote", 1:9, sep="") | |
outputHRR <- rollcall(data = depVotes, yea = 1, nay = 6, missing = c(8,9), notInLegis = 0, legis.names = legisNames, vote.names = voteNames) | |
outputOC <- oc(rcObject = outputHRR, dims = 2, minvotes = 1, polarity = c(4,323)) |
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
rank correctYea wrongYea wrongNay correctNay volume coord1D coord2D | |
Legis1 9.5 1 0 0 3 0.154 0.1393427 2.439471e-04 | |
Legis2 9.5 1 0 0 3 0.213 0.1393427 2.439471e-04 | |
Legis3 7.0 2 0 0 2 0.131 0.1392035 -9.211715e-25 | |
Legis4 7.0 2 0 0 2 0.029 0.1392035 -9.211715e-25 | |
Legis5 7.0 2 0 0 2 0.070 0.1392035 -9.211715e-25 | |
Legis6 3.0 0 0 0 0 0.000 0.0000000 0.000000e+00 | |
Legis7 3.0 0 0 0 0 0.000 0.0000000 0.000000e+00 | |
Legis8 3.0 0 0 0 0 0.000 0.0000000 0.000000e+00 | |
Legis9 3.0 0 0 0 0 0.000 0.0000000 0.000000e+00 |
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
# Create dummy data | |
a <- rnorm(n = 100, mean = 50, sd = 5) | |
b <- rnorm(n = 100, mean = 50, sd = 5) | |
c <- rnorm(n = 100, mean = 50, sd = 5) | |
mydf <- data.frame(A = a, B = b, C = c, row.names = c(1:100)) | |
library(ade4) | |
# Running a Correspondence Analysis | |
myCA <- dudi.coa(df = mydf,scannf = FALSE, nf = 2) | |
# Getting distances for Hclust | |
myDist <- dist.dudi(myCA, amongrow = TRUE) |
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
require(shiny) | |
require(sp) | |
require(rgdal) | |
runApp( | |
list( | |
ui = bootstrapPage( | |
fileInput('inputdata', 'Input file',accept=c('.csv')), | |
plotOutput("xyPlot"), | |
downloadButton('downloadShp', 'DownloadSHP') | |
), |