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
## Este exemplo provê um código em R que outros usuários podem reproduzir | |
## para facilitar a solução de problemas observados. | |
## | |
## Na R-br em: http://r-br.2285057.n4.nabble.com/R-br-Produzindo-um-Codigo-Minimo-Reproduzivel-CMR-td3674188.html | |
################################################################# | |
## PASSO 1: Carregue os pacotes necessários no início do código | |
################################################################# | |
library(splines) |
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
## Por Benilton Carvalho | |
## | |
## Determinando os parâmetros da Normal | |
media <- 170 | |
stder <- 8 | |
## Criando o grid no qual deseja-se visualizar a densidade | |
x <- seq(media-3*stder, media+3*stder, .01) | |
## Determinando a densidade em cada ponto do grid |
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
## Installing the oligo package | |
## Requires biocLite() | |
source("http://www.bioconductor.org/biocLite.R") | |
biocLite("oligo") |
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
## funcao initial | |
equantileByCounts <- function(x, counts, qs){ | |
tot <- sum(counts) | |
i <- order(x) | |
x <- x[i] | |
counts <- counts[i] | |
partial <- cumsum(counts) | |
qsObs <- qs*tot | |
start <- floor(qsObs) | |
end <- ceiling(qsObs) |
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
## Conjunto de dados | |
x = structure(list(pop = c(23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, | |
23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, | |
23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, | |
23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L), ind = c(12L, | |
12L, 14L, 14L, 18L, 18L, 20L, 20L, 21L, 21L, 22L, 22L, 24L, 24L, | |
25L, 25L, 26L, 26L, 27L, 27L, 28L, 28L, 29L, 29L, 31L, 31L, 32L, | |
32L, 33L, 33L, 34L, 34L, 36L, 36L, 42L, 42L, 49L, 49L, 51L, 52L, | |
52L, 58L, 58L, 59L, 59L), morph = c("long", "long", "long", "long", | |
"long", "long", "long", "long", "long", "long", "semi-M_AL", |
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
volta.cokri2 <- function(mat.cokri, num.simu, retorna.tudo=FALSE, int.conf=0.95){ | |
## Author: Wagner Bonat / Ana Beatriz Martins / Paulo Justiniano | |
## Modified for parallel and better use of RAM by: Benilton Carvalho | |
require(parallel) | |
nlinhas <- dim(mat.cokri[[1]])[1] | |
f <- function(i){ | |
g <- mvrnorm(n=1, mat.cokri[[1]], mat.cokri[[2]]) | |
seq1 <- seq(1, nlinhas, by=2) | |
gerado <- data.frame(g[seq1], g[seq1+1L]) |
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
library(pdInfoBuilder) | |
seed <- new("AffySTPDInfoPkgSeed", | |
version="3.6.0", | |
license="Artistic-2.0", | |
pgfFile=dir(patt=".pgf$"), | |
clfFile=dir(patt=".clf$"), | |
probeFile=dir(patt="probeset.csv$"), | |
transFile=dir(patt="transcript.csv$"), | |
coreMps=dir(patt="core.mps$"), | |
fullMps=dir(patt="full.mps$"), |
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
## Gerando dados | |
set.seed(1) | |
y1 = rnorm(20, 2.5, 1.25) | |
y2 = rnorm(20, 5, 1.25) | |
Y = c(y1, y2) | |
data(faithful) | |
plot(faithful$waiting, faithful$eruptions) |
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
## Gerando dados | |
set.seed(1) | |
y1 = rnorm(20, 2.5, 1.25) | |
y2 = rnorm(20, 5, 1.25) | |
Y = c(y1, y2) | |
## | |
data(faithful) | |
plot(faithful$waiting, faithful$eruptions) |
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
data(cars) | |
fit = lm(dist ~ speed, data=cars) | |
summary(fit) | |
system.time({ | |
nBoot = 10000 | |
coefs = rep(NA, nBoot) | |
for (j in 1:nBoot){ | |
i = sample(nrow(cars), replace = TRUE) | |
fitBoot = lm(dist ~ speed, data=cars[i,]) |
OlderNewer