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
url_sei <- "https://sei.economia.gov.br" | |
user_sei <- "usuario aqui" | |
pwd_sei <- "senha aqui" | |
org_sei <- "0" ## se tem mais de uma organizacao no login pode ter que mudar aqui. | |
library(RSelenium) | |
library(dplyr) | |
library(rvest) | |
library(purrr) | |
library(tictoc) |
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
set.seed(20091975) | |
## number of stimuli | |
J <- 6 | |
## draw the stimuli. hold them fixed | |
x <- sort(runif(J)) | |
sim <- function( | |
N=100, ## number of individuals | |
intercept=0, |
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
write('model { | |
for (i in 1:n.rows) { | |
y[i] ~ dnorm(y.hat[i], tau.y) | |
y.hat[i] <- b.0 + b.1 * x[i] | |
} | |
b.0 ~ dnorm (0, 1/(sdp^2)) | |
b.1 ~ dnorm (0, 1/(sdp^2)) | |
tau.y ~ dgamma(.0001, .0001) | |
sigma.y <- pow(tau.y, -(1/2)) |
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
plot.heat <- function(tmp,state.map,z,title=NULL,breaks=NULL,cex.legend=1,bw=.2,col.vec=NULL,main=NULL,plot.legend=TRUE, ...) { | |
tmp@data$zCat <- cut(tmp@data[,z],breaks,include.lowest=TRUE) | |
cutpoints <- levels(tmp@data$zCat) | |
if (is.null(col.vec)) col.vec <- heat.colors(length(levels(tmp@data$zCat))) | |
cutpointsColors <- col.vec | |
levels(tmp@data$zCat) <- cutpointsColors | |
cols <- as.character(tmp$zCat) | |
##cols <- "white" | |
plot(tmp,border=cols, lwd=bw,axes = FALSE, las = 1,col=as.character(tmp@data$zCat),main="A", ...) | |
if (!is.null(state.map)) { |
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
## twitter poster for R | |
## allows delays | |
##based on http://www.cerebralmastication.com/?p=274 | |
tweet.now <- function(status,userpwd="username:password") { | |
require(tcltk) | |
require("RCurl") | |
opts <- curlOptions(header = FALSE, userpwd = userpwd, netrc = FALSE) | |
method <- "http://twitter.com/statuses/update.xml?status=" | |
encoded_status <- URLencode(status) | |
request <- paste(method,encoded_status,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
## First do the unix account setup http://wiki.dreamhost.com/Unix_account_setup | |
cd ${HOME} | |
# create the first level directories (and log/setup) | |
mkdir -pv soft run www log log/setup backup data | |
# create the second level directories within run (our own FHS) | |
for subdir in bin etc include lib man share | |
do | |
mkdir -pv run/${subdir} | |
done | |
# symlink so that man pages stay all in the same place |