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 the packages | |
library(ggplot2) | |
library(maptools) | |
library(OpenStreetMap) | |
gpclibPermit() | |
#Import the data | |
text <- download.file("https://raw.github.com/alstat/Analysis-with-Programming/master/2013/R/R-Mapping-Super-Typhoon-Yolanda-Haiyan-Track/TyDatYolanda2013.csv", | |
destfile = "/tmp/test.csv", method = "curl") | |
tydat <- read.csv("/tmp/test.csv", header = TRUE) |
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
################################### | |
## CartoDB 2.0 Install [Working] ## | |
## Tested on Ubuntu 12.04 ## | |
################################### | |
# Change password | |
passwd | |
adduser [username] | |
adduser [username] sudo |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
curl -s "http://talos.irpi.cnr.it/zareport/za.php?action=get_full_report_data&cod=Tosc-A2" |
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
corstar <- function(x, y = NULL, use = "pairwise", method = "pearson", round = 3, row.labels, col.labels, ...) { | |
require(psych) | |
ct <- corr.test(x, y, use, method) # calculate correlation | |
r <- ct$r # get correlation coefs | |
p <- ct$p # get p-values | |
stars <- ifelse(p < .001, "***", ifelse(p < .01, "** ", ifelse(p < .05, "* ", " "))) # generate significance stars | |
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
import io, json | |
from TwitterAPI import TwitterAPI | |
CONSUMER_KEY = '' | |
CONSUMER_SECRET = '' | |
ACCESS_TOKEN_KEY = '' | |
ACCESS_TOKEN_SECRET = '' | |
api = TwitterAPI(CONSUMER_KEY, | |
CONSUMER_SECRET, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
viewwhere<-function(object,zoom = 17){ | |
require(leaflet) | |
if (is.null(object$lon) && is.null(object$lat)) | |
{ stop("Object must be have coordinates lat and lon slot." )}; | |
m = leaflet() %>% addTiles() | |
m = m %>% setView(object$lon, object$lat, zoom = zoom) | |
m %>% addPopups(object$lon,object$lat, paste0('The location of the object is here!')) | |
return(m) |
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
listfiles=gsub(".shp","",Sys.glob("*.shp")) | |
read_project=function(x) | |
{ | |
require(maptools) | |
require(rgdal) | |
temp=readShapePoly(x) | |
proj4string(temp)=CRS("+init=epsg:32632") | |
return(spTransform(temp, CRS("+init=epsg:4326"))) | |
} |
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
ls_files=Sys.glob("*.json") | |
tweetdf(jsonfile) | |
tweetdf=function(jsonfile) { | |
require(jsonlite) | |
ex=jsonlite::fromJSON(jsonfile) |
OlderNewer