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
# go to 'https://developers.facebook.com/tools/explorer' to get your access token | |
access_token <- "******************* INPUT YOUR ACCESS TOKEN ******************************" | |
require(RCurl) | |
require(rjson) | |
# Facebook json function copied from original (Romain Francois) post | |
facebook <- function( path = "me", access_token, options){ | |
if( !missing(options) ){ | |
options <- sprintf( "?%s", paste( names(options), "=", unlist(options), collapse = "&", sep = "" ) ) |
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
function getTweets(searchTerm, maxResults, sinceid, languageCode) { | |
//Based on Mikael Thuneberg getTweets - mod by mhawksey to convert to json | |
// if you include setRowsData this can be used to output chosen entries | |
var data = []; | |
var idx = 0; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sumSheet = ss.getSheetByName("Readme/Settings"); | |
if (isConfigured()){ | |
var oauthConfig = UrlFetchApp.addOAuthService("twitter"); | |
oauthConfig.setAccessTokenUrl("https://api.twitter.com/oauth/access_token"); |
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
# 18/05/2013 | |
# Key words : TextMining, Elections, France, Debate, 2nd Round | |
# We use the packages qdap from (donner le lien) and | |
# tm to perform textmining analysis and the classical | |
# package like ggplot or RColorBrewer to get the graphics pretty. | |
suppressPackageStartupMessages(require(twitteR)) | |
suppressPackageStartupMessages(require(XML)) | |
suppressPackageStartupMessages(require(tm)) | |
suppressPackageStartupMessages(require(rgdal)) |
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.
OlderNewer