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
| var voronoi = new Voronoi(); | |
| var bbox = {xl:-window.innerWidth,xr:window.innerWidth*2,yt:-window.innerHeight,yb:window.innerHeight*2}; | |
| var voronoiLines = []; | |
| var sites = []; | |
| function resetVoronoi(){ | |
| for(var vi in voronoiLines){ | |
| var line = voronoiLines[vi]; | |
| line.setMap(null); | |
| } |
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
| var markersArray = []; | |
| function addMarkerOnClick(mapClient){ | |
| google.maps.event.addListener(mapClient, 'click', function(event) { | |
| addMarker(event.latLng); | |
| }); | |
| } | |
| function addMarker(mapClient, location) { | |
| marker = new google.maps.Marker({ |
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
| var map; | |
| function success(position) { | |
| var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); | |
| loadMap(latlng); | |
| //FROM gMapsMarkers.js | |
| //addMarker(latlng); | |
| } | |
| function error(msg) { |
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
| function success(position) { | |
| var s = document.querySelector('#status'); | |
| if (s.className == 'success') { | |
| return; | |
| } | |
| s.innerHTML = "Você foi localizado!"; | |
| s.className = 'success'; |
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
| # regression models from dalgaard | |
| library("ISwR") | |
| ?thuesen | |
| thuesen | |
| attach(thuesen) | |
| lm(short.velocity~blood.glucose) | |
| summary(lm(short.velocity~blood.glucose)) #the median should not be far from zero, and the minimum and maximum should be roughly equal in absolute value | |
| plot(blood.glucose,short.velocity) | |
| abline(lm(short.velocity~blood.glucose)) |
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.install <- function(pkg, github=""){ | |
| req <- suppressWarnings( | |
| suppressMessages( | |
| require(package=paste(pkg), character.only=TRUE) | |
| ) | |
| ); | |
| #print(github); | |
| if(!req){ | |
| installOk <- FALSE; | |
| if(length(github)<=0){ |
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
| # reading data into R: http://goo.gl/bAUmj | |
| library("ISwR") | |
| #factors | |
| pain <- c(0,3,2,2,1) | |
| fpain <- factor(pain,levels=0:3) | |
| levels(fpain) <- c("none","mild","medium","severe") | |
| fpain |
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.packages("ISwR") | |
| require("ISwR") | |
| x <- rnorm(50) | |
| mean(x) | |
| sd(x) | |
| var(x) | |
| median(x) | |
| quantile(x) | |
| pvec <- seq(0,1,0.1) | |
| pvec |