blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 2
327
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
91
| license_type
stringclasses 2
values | repo_name
stringlengths 5
134
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 46
values | visit_date
timestamp[us]date 2016-08-02 22:44:29
2023-09-06 08:39:28
| revision_date
timestamp[us]date 1977-08-08 00:00:00
2023-09-05 12:13:49
| committer_date
timestamp[us]date 1977-08-08 00:00:00
2023-09-05 12:13:49
| github_id
int64 19.4k
671M
⌀ | star_events_count
int64 0
40k
| fork_events_count
int64 0
32.4k
| gha_license_id
stringclasses 14
values | gha_event_created_at
timestamp[us]date 2012-06-21 16:39:19
2023-09-14 21:52:42
⌀ | gha_created_at
timestamp[us]date 2008-05-25 01:21:32
2023-06-28 13:19:12
⌀ | gha_language
stringclasses 60
values | src_encoding
stringclasses 24
values | language
stringclasses 1
value | is_vendor
bool 2
classes | is_generated
bool 2
classes | length_bytes
int64 7
9.18M
| extension
stringclasses 20
values | filename
stringlengths 1
141
| content
stringlengths 7
9.18M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b2fe740d264a86361f34ee913e9c1fbaeec6949e
|
9f02785abd397cbc46c20c3d5858163a6847285a
|
/NeuralNetwork/nnet_conv.R
|
7a51a7b1d2648081d69c669f4dbaefe78e5f710c
|
[
"MIT"
] |
permissive
|
daelsepara/machine-learning-r
|
c764d53c632819ef249c0f8e4cc6a926e834672a
|
5d7dad83cc71d40ffdd93d73d4ffc1234ccac613
|
refs/heads/master
| 2021-01-10T12:42:45.403223
| 2019-02-20T14:40:45
| 2019-02-20T14:40:45
| 54,004,004
| 1
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 4,275
|
r
|
nnet_conv.R
|
require(pracma)
# convolution layer
nnet_conv <- function(input, feature, shape = "full") {
# input dimensions
ix = ncol(input)
iy = nrow(input)
# filter dimension
fx = ncol(feature)
fy = nrow(feature)
# convolution dimensions
cx = ix + fx - 1
cy = iy + fy - 1
if (iy >= fy && ix >= fx) {
result = array(0, c(cy, cx, iz))
for (cj in 2:(cy + 1)) {
for (ci in 2:(cx + 1)) {
for (ky in 1:iy) {
if (cj - ky > 0 && cj - ky <= fy) {
for (kx in 1:ix) {
if (ci - kx > 0 && ci - kx <= fx) {
result[cj - 1, ci - 1] = result[cj - 1, ci - 1] + input[ky, kx] * feature[cj - ky, ci - kx]
}
}
}
}
}
}
if (shape == "valid") {
result = result[fy:(cy - fy + 1), fx:(cx - fx + 1)]
} else if (shape == "same") {
dx = (cx - ix)/2
dy = (cy - iy)/2
result = result[(1 + ceil(dy)):(cy - floor(dy)), (1 + ceil(dx)):(cx - floor(dx))]
}
return(drop(result))
} else {
stop('input and filter dimensions are incompatible')
}
}
# convolution layer
nnet_conv3 <- function(input, feature, shape = "full") {
# input dimensions
ix = ncol(input)
iy = nrow(input)
iz = dim(input)[3]
# filter dimension
fx = ncol(feature)
fy = nrow(feature)
fz = dim(feature)[3]
# convolution dimensions
cx = ix + fx - 1
cy = iy + fy - 1
cz = iz + fz - 1
if (iy >= fy && ix >= fx && iz >= fz) {
result = array(0, c(cy, cx, cz))
for (ck in 2:(cz + 1)) {
for (cj in 2:(cy + 1)) {
for (ci in 2:(cx + 1)) {
for (kz in 1:iz) {
if (ck - kz > 0 && ck - kz <= fz) {
for (ky in 1:iy) {
if (cj - ky > 0 && cj - ky <= fy)
{
for (kx in 1:ix) {
if (ci - kx > 0 && ci - kx <= fx) {
result[cj - 1, ci - 1, ck - 1] = result[cj - 1, ci - 1, ck - 1] + input[ky, kx, kz] * feature[cj - ky, ci - kx, ck - kz]
}
}
}
}
}
}
}
}
}
if (shape == "valid") {
result = result[fy:(cy - fy + 1), fx:(cx - fx + 1), fz:(cz - fz + 1)]
} else if (shape == "same") {
dx = (cx - ix)/2
dy = (cy - iy)/2
dz = (cz - iz)/2
result = result[(1 + ceil(dy)):(cy - floor(dy)), (1 + ceil(dx)):(cx - floor(dx)), (1 + ceil(dz)):(cz - floor(dz))]
}
return(drop(result))
} else {
stop('input and filter dimensions are incompatible')
}
}
# pooling layer
nnet_pool <- function(input, feature, steps_) {
ix = ncol(input)
iy = nrow(input)
if (ix >= feature && iy >= feature) {
colseq = seq(1, ix, feature)
rowseq = seq(1, iy, feature)
cols = length(colseq)
rows = length(rowseq)
result = array(0, c(rows, cols))
for (y in 1:rows) {
for(x in 1:cols) {
col = colseq[x]
row = rowseq[y]
px = col + feature - 1
py = row + feature - 1
if (px > ix) {
px = ix
}
if (py > iy) {
py = iy
}
result[y, x] = max(input[row:py, col:px])
}
}
return(result)
} else {
stop('input and window dimensions are incompatible')
}
}
nnet_expand <- function(A, SZ, scale = 1.0)
{
if (length(dim(A) == length(SZ))) {
return (scale * repmat(A, SZ[1], SZ[2]))
} else {
stop('Length of size vector must equal ndims(A)')
}
}
# zero-padding function
nnet_pad <- function(input, padsize = 0) {
if (padsize >= 0) {
if (padsize > 0) {
# zero pad columns
conv_c = cbind(array(0, c(dim(input)[1], padsize)), input, array(0, c(dim(input)[1], padsize)))
# zero pad rows
conv_r = rbind(array(0, c(padsize, ncol(conv_c))), conv_c, array(0, c(padsize, ncol(conv_c))))
return(conv_r)
} else {
return(input)
}
} else {
stop('padsize must be >= 0')
}
}
|
41b3138ae0be290ed1f0e6585fe9a5c52c84df76
|
8e3de2ab24e05f90617605f698fff026bde32a17
|
/DataScience/KuboTakuya/chapter-08/plot-metro-prior.R
|
3d73b901bd8da2346ce69c38b25117c7f9ff56ba
|
[
"MIT"
] |
permissive
|
YuichiroSato/Blog
|
77055ede88807ced98c652d827ccc8b850b34ed1
|
42df73cba30a45c28cd2b70224685c430e40928f
|
refs/heads/master
| 2022-11-04T20:36:38.262536
| 2022-10-24T17:26:14
| 2022-10-24T17:26:14
| 168,289,166
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,446
|
r
|
plot-metro-prior.R
|
dataGenerator <- function(dataSize) {
gen <- function() {
m <- 3
if (runif(1, 0, 1) < 0.5) {
m <- 7
}
q <- rnorm(1, mean = m, sd = 0.1)
rnorm(1, mean = q[1], sd = 1)
}
data <- vector(length = dataSize)
for (i in seq(1, dataSize + 1)) {
data[i] <- gen()
}
data
}
data <- dataGenerator(100)
hist(data, breaks = seq(0, 10, by = 0.1), main = "500 samples", xlab = "data")
likelihood <- function(q) {
sum(log(dnorm(data, mean = q, sd = 1)))
}
prior <- function(q) {
(dnorm(q, mean = 3, sd = 0.1) + dnorm(q, mean = 7, sd = 0.1)) / 2
}
posterior <- function(q) {
likelihood(q) + log(prior(q))
}
develop <- function(q) {
if (runif(1, 0, 1) < 0.5) {
q + 0.01
} else {
q - 0.01
}
}
sampling <- function(n, init, evaluator) {
evaluator <- match.fun(evaluator)
q <- init
ql <- evaluator(q)
samples <- vector(length = n)
i <- 1
while(i <= n) {
p <- develop(q)
pl <- evaluator(p)
r <- log(runif(1, 0, 1))
if (ql < pl || r < pl - ql) {
q <- p
ql <- pl
}
samples[i] <- p
i <- i + 1
}
samples
}
a1 <- sampling(25000, 3, likelihood)
a2 <- sampling(25000, 7, likelihood)
hist(c(a1, a2), breaks = seq(0, 10, by = 0.01), main = "MCMC sampling, lilelihood", xlab = "q")
b1 <- sampling(25000, 3, posterior)
b2 <- sampling(25000, 7, posterior)
hist(c(b1, b2), breaks = seq(0, 10, by = 0.01), main = "MCMC sampling, posterior", xlab = "q")
|
6d4264fde39e573245e19ac759aca6c238c1ca2e
|
d393abd55061886f14db86c3d17e1e3681d77ec9
|
/r-lab1/src/R-lab_2.R
|
069101828cc4a5326b8897c0e6f0313ed32ac08f
|
[] |
no_license
|
wuhaixu2016/R-Lab
|
c134421aabbf612c814a33a384c5b0026cba5924
|
c55b2a987c166a9d519fa3511375db145567979d
|
refs/heads/master
| 2020-04-17T06:56:41.284673
| 2019-01-18T05:08:50
| 2019-01-18T05:08:50
| 166,346,396
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,006
|
r
|
R-lab_2.R
|
False = 0
if(False){
note = 'For Question Two'
}
if(False){
note = 'for mySim
u, r are for rnorm
n, m are number for each sim. and times for sim'
}
mySim <- function(u, r, n, m){
x_sim = numeric(m)
for(i in 1:m){
data <- rnorm(n, u, r)
x_sim[i] = sum(data)
x_sim[i] = x_sim[i]/n
}
if(False){
note = 'feature for E(E(sim data)),'
}
return (x_sim)
}
if(False){
note = 'draw'
}
mat <- matrix(1:4, 2, 2)
layout(mat)
data = mySim(0,1,50,50000)
hist(data)
par(new=TRUE)
curve(dnorm(x,mean=0,sd=sqrt(1/50))*50000,from=-0.5,to=0.5)
par(new=FALSE)
data = mySim(0,1,100,50000)
hist(data)
par(new=TRUE)
curve(dnorm(x,mean=0,sd=sqrt(1/100))*50000,from=-0.5,to=0.5)
par(new=FALSE)
data = mySim(0,1,200,50000)
hist(data)
par(new=TRUE)
curve(dnorm(x,mean=0,sd=sqrt(1/200))*50000,from=-0.5,to=0.5)
par(new=FALSE)
data = mySim(0,1,400,50000)
hist(data)
par(new=TRUE)
curve(dnorm(x,mean=0,sd=sqrt(1/400))*50000,from=-0.5,to=0.5)
par(new=FALSE)
|
c3e6138c2256875b37d6f85cbefd69ef513cf022
|
51be1242b0a3a7d7b0468a7356656b626138ba83
|
/old/s1s2_Original.R
|
b034f35a2f2e790fcc453e37e2cbe5d244adf5cd
|
[] |
no_license
|
tyzjames/Wolverine-Mean-Reversion
|
af6a08ba39d701fbbbf1fdc0e32449823e64364b
|
8f1da29518bd10b3645417b9d8d6b83c8cf9f099
|
refs/heads/master
| 2021-01-15T07:54:09.058499
| 2015-05-12T03:12:31
| 2015-05-12T03:12:31
| 33,780,077
| 3
| 2
| null | null | null | null |
UTF-8
|
R
| false
| false
| 9,690
|
r
|
s1s2_Original.R
|
library(caTools)
library(TTR)
library(gtools)
#Read CSV data
readData<-function(inFile){
print("Reading Data")
tempFile<-tryCatch({
return(inFile[, c("datetime","open","high","low","close")])
},
error=function(cond){
message("Data column headers do not match [datetime],[open],[high],[low],[close]")
message("Reading data as [datetime],[open],[high],[low],[close]")
return(inFile[, c(1:5)])
},
finally={}
)
}
#Process the raw csv data
processData <- function(inFile, p.x, multiplier, tickSize){
print("Processing Data")
df.temp<-data.frame(readData(inFile))
#Set parameter
colnames(df.temp) <- c("datetime","open","high","low","close")
df.temp[,c("open","high","low","close")]<-df.temp[,c("open","high","low","close")]*multiplier
#Get ATR
df.temp$ATR <- ATR(df.temp[, c("high","low","close")], n = p.x)[, "atr"]*tickSize
df.temp$ATR[is.nan(df.temp$ATR)] = 0 #Replace NaN with 0
print("Get previous day prices")
#Get previous day prices
df.temp$pOpen <- c(0, df.temp$open[-nrow(df.temp)])
df.temp$pClose <- c(0, df.temp$close[-nrow(df.temp)])
df.temp$pHigh<- c(0, df.temp$high[-nrow(df.temp)])
df.temp$pLow <- c(0, df.temp$low[-nrow(df.temp)])
#Get highest high and lowerst low over previous x period and calculate relative true value
#Taking previous high/low as a start because we dont want to use current high/low to calculate S1S2
df.temp$hHigh <- runmax(df.temp$pHigh, p.x, align="right", endrule="keep")
df.temp$lLow <- runmin(df.temp$pLow, p.x, align="right", endrule="keep")
df.temp$hHighlLowDiff <- df.temp$hHigh - df.temp$lLow
df.temp$relCls <- (df.temp$close - df.temp$lLow)/df.temp$hHighlLowDiff
df.temp$relCls[is.na(df.temp$relCls) | is.infinite(df.temp$relCls)]<-0
print("Rolling mean and SD for zScore")
#Rolling mean and SD for zScore
df.temp$mean<-runmean(df.temp$open, p.x, alg=c("C"),endrule=c("mean"),align = c("right"))
df.temp$sd<- runsd(df.temp$open, p.x, endrule=c("sd"),align = c("right"))
df.temp$zScore<-(df.temp$open-df.temp$mean)/df.temp$sd
vrb<-c("datetime","open","pOpen","close","pClose","relCls","ATR", "zScore")
return (df.temp[,vrb])
}
#Merging data from two data frames
mergeData<-function(df.aa, df.bb, p.x){
print("Merging data")
df.x<-merge(data.frame(df.aa[p.x:nrow(df.aa),]),data.frame(df.bb[p.x:nrow(df.bb),]), by="datetime")
return (df.x)
}
processSignals<-function(df.merged, p.x, stdev, thres, signal.type, ts, x.size, y.size, updateProgress=NULL){
#To process signals to enter/exit trade
print("Processing signals")
df.x<-df.merged
print("Run asset correlation")
asset.cor<<-cor(matrix(c(df.x$open.x, df.x$open.y), ncol=2))[1,2]
print("Check if positive or negative correlation")
if (asset.cor>0){
df.x$s1s2<- round(df.x$relCls.x - df.x$relCls.y,3) #S1-S2 if positive correlation
df.x$zScore<-round(df.x$zScore.x-df.x$zScore.y,3)
} else {
df.x$s1s2<- round(df.x$relCls.x-(1-df.x$relCls.y),3) #S1-(1-S2) if neg correlation
df.x$zScore<-round(df.x$zScore.x-(1-df.x$zScore.y),3)
}
df.x$zScore[is.na(df.x$zScore) | is.infinite(df.x$zScore)]<-0
print("Getting Exit Signals")
df.x$exit<-ifelse(sign(df.x$s1s2)!=c(NA,sign(df.x$s1s2)[-nrow(df.x)]),1,0)
df.x$fExit<-c(0,df.x$exit[-nrow(df.x)])
print("s1s2 BBand")
df.x$s1s2.bband<-BBands(HLC=df.x$s1s2, n = p.x, sd=stdev)
print("Add BBands for zScore. Execute when outside of BBand.")
#Add BBands for zScore. Execute when outside of BBand.
df.x$z.bband<-BBands(HLC=df.x$zScore, n= p.x, sd=stdev)
print("Get Primary Entry signals")
# df.x$s1s2.signal<-ifelse(df.x$s1s2<=df.x$s1s2.bband[,"dn"], 1, ifelse(df.x$s1s2>=df.x$s1s2.bband[,"up"], 2, 0))
df.x$s1s2.signal<-ifelse(df.x$s1s2<=thres*-1, 1, ifelse(df.x$s1s2>=thres, 2, 0)) #Using Threshold
print("Compile all signals")
if ("zScore BBand" %in% signal.type) {
df.x$sig.z <- ifelse(df.x$zScore<=df.x$z.bband[,"dn"] | df.x$zScore>= df.x$z.bband[,"up"], T, F)
df.x$sig.z[is.na(df.x$z.signal) | is.null(df.x$z.signal)] <- F
} else {
df.x$sig.z <- T
}
df.x$z.bband.up<-df.x$z.bband[,"up"]
df.x$z.bband.dn<-df.x$z.bband[,"dn"]
if ("s1s2" %in% signal.type) {
df.x$sig.s1s2.long <- ifelse(df.x$s1s2.signal==1,T,F)
df.x$sig.s1s2.sht <- ifelse(df.x$s1s2.signal==2,T,F)
} else {
df.x$sig.s1s2.long <- ifelse(df.x$s1s2>=0,T,F)
df.x$sig.s1s2.sht <- ifelse(df.x$s1s2<0,T,F)
}
#Compile all signals except primary S1S2 signal
df.x$sig.final<- df.x$sig.z
df.x$entry <- ifelse(df.x$sig.final & df.x$sig.s1s2.long, 1, ifelse(df.x$sig.final & df.x$sig.s1s2.sht, 2, 0))
df.x$fEntry <- c(0,df.x$entry[-nrow(df.x)]) #forward signal
#ATR Ratio
df.x$ATR.ratio<-y.size #ATR Ratio = 1
# df.x$ATR.ratio<-round(((df.x$ATR.y)/(df.x$ATR.x))*x.size) #ATR.y/ATR.x
# df.x$ATR.ratio<-round(((df.x$ATR.x)/(df.x$ATR.y))*x.size) #ATR.x/ATR.y
vrb <- c("datetime","open.x","pOpen.x","close.x","pClose.x","open.y","pOpen.y","close.y","pClose.y"
,"s1s2","s1s2.signal","zScore","z.signal","signal","fSignal","exit","fExit","ATR.ratio","s1s2.slope",
"z.bband.lower","z.bband.upper","z.bband.ma")
return (df.x[(p.x*2):nrow(df.x),])
}
backTest<- function(df.ab, ts, x.size, updateProgress=NULL){
print("Backtesting")
df.x<-df.ab
rowCount<-nrow(df.x)
#Today's close minus today's open to calculate profit for Enter period
df.x$clOp.x<-df.x$close.x-df.x$open.x
df.x$clOp.y<-df.x$close.y-df.x$open.y
#Today's close minus ytd close to calculate profit for holding period
df.x$clPcl.x<-df.x$close.x-df.x$pClose.x
df.x$clPcl.y<-df.x$close.y-df.x$pClose.y
#Today's open minus ytd close to calculate profit for exit period
df.x$opPcl.x<-df.x$open.x-df.x$pClose.x
df.x$opPcl.y<-df.x$open.y-df.x$pClose.y
df.x$pos.x<-0
df.x$pos.y<-0
df.x$size.x<-0
df.x$size.y<-0
df.x$price.x<-0
df.x$price.y<-0
df.x$pl.x<-0
df.x$pl.y<-0
if (asset.cor>0){
df.x$pos.x[df.x$fEntry==1]<- 1
df.x$pos.y[df.x$fEntry==1]<- -1
df.x$pos.x[df.x$fEntry==2]<- -1
df.x$pos.y[df.x$fEntry==2]<- 1
} else {
df.x$pos.x[df.x$fEntry==1]<- -1
df.x$pos.y[df.x$fEntry==1]<- -1
df.x$pos.x[df.x$fEntry==2]<- 1
df.x$pos.y[df.x$fEntry==2]<- 1
}
df.x$size.x[df.x$entry!=0]<-x.size
df.x$size.y[df.x$entry!=0]<-df.x$ATR.ratio[df.x$entry!=0]
df.x$price.x[df.x$fEntry!=0]<-df.x$open.x[df.x$fEntry!=0]
df.x$price.y[df.x$fEntry!=0]<-df.x$open.y[df.x$fEntry!=0]
df.x$inTrade<-0
inTrade<-F
startRow<-0
endRow<-0
for (i in 2:rowCount){
if (!inTrade) {
if (df.x$fEntry[i]!=0){
inTrade<-T
startRow<-i
}
} else {
if (df.x$fExit[i]==1){
inTrade<-F
endRow<-i
df.x$inTrade[startRow:endRow]<-1 #Hold trade
df.x$inTrade[startRow]<-2 #Enter
df.x$inTrade[endRow]<-3 #Exit
df.x$pos.x[startRow:endRow]<-df.x$pos.x[startRow]
df.x$pos.y[startRow:endRow]<-df.x$pos.y[startRow]
df.x$price.x[startRow:endRow]<-df.x$price.x[startRow]
df.x$price.y[startRow:endRow]<-df.x$price.y[startRow]
df.x$size.x[startRow:endRow]<-df.x$size.x[startRow-1]
df.x$size.y[startRow:endRow]<-df.x$size.y[startRow-1]
startRow<-0
endRow<-0
}
}
if (is.function(updateProgress) & i%%(rowCount%/%20)==0) {
text <- paste("Backtesting:", paste(as.character(round((i/rowCount)*100)),"%",sep=""))
updateProgress(detail = text)
}
}
enterTrade<- df.x$inTrade==2
holdTrade<-df.x$inTrade==1
exitTrade<-df.x$inTrade==3
#Original method of calculation. Uses Open minus close for enter, previous close minus current close for hold
#, and previous close minus current open for exit
df.x$pl.x[enterTrade]<-df.x$pos.x[enterTrade]*df.x$size.x[enterTrade]*df.x$clOp.x[enterTrade]*ts[1]
df.x$pl.y[enterTrade]<-df.x$pos.y[enterTrade]*df.x$size.y[enterTrade]*df.x$clOp.y[enterTrade]*ts[2]
df.x$pl.x[exitTrade]<-df.x$pos.x[exitTrade]*df.x$size.x[exitTrade]*df.x$opPcl.x[exitTrade]*ts[1]
df.x$pl.y[exitTrade]<-df.x$pos.y[exitTrade]*df.x$size.y[exitTrade]*df.x$opPcl.y[exitTrade]*ts[2]
df.x$pl.x[holdTrade]<-df.x$pos.x[holdTrade]*df.x$size.x[holdTrade]*df.x$clPcl.x[holdTrade]*ts[1]
df.x$pl.y[holdTrade]<-df.x$pos.y[holdTrade]*df.x$size.y[holdTrade]*df.x$clPcl.y[holdTrade]*ts[2]
df.x$pl.x[enterTrade]<-0
df.x$pl.y[enterTrade]<-0
df.x$daily.pl<-round(df.x$pl.x + df.x$pl.y,2)
df.x$total.pl<-round(cumsum(df.x$daily.pl),2)
return (df.x)
}
#Return table that is organized for download
processDownloadData<-function(input){
input <- df.eBTx[,c("datetime","open.x","close.x","open.y","close.y", "s1s2","zScore", "z.bband.up","z.bband.dn", "pos.x", "size.x", "pos.y","size.y","price.x","price.y","pl.x","pl.y","daily.pl","total.pl","inTrade")]
input$pos.x.str<-ifelse(input$pos.x==-1,"Short",ifelse(input$pos.x==1,"Long",""))
input$pos.y.str<-ifelse(input$pos.y==-1,"Short",ifelse(input$pos.y==1,"Long",""))
input$inTrade.str<-ifelse(input$inTrade==2,"Enter",ifelse(input$inTrade==3,"Exit",ifelse(input$inTrade==1,"Hold","")))
input<-input[c("datetime","open.x","close.x","open.y","close.y", "s1s2","zScore", "z.bband.up","z.bband.dn", "inTrade.str","pos.x.str", "size.x", "pos.y.str","size.y","price.x","price.y","pl.x","pl.y","daily.pl","total.pl")]
colnames(input)<-c("Date and Time", "O1","C1", "O2","C2", "S1S2","zScore", "zScore BBand Up","zScore BBand Dn", "Signal","Pos1","Size1","Pos2","Size2","Price1","Price2","Profit1","Profit2","P/L","Total P/L")
return(input)
}
|
da2e12c9c7c63abf628c959029d7ee58a5422aa5
|
a7914cffb91911b3bbf2e1f51f76956adad336ad
|
/consistency_movement.R
|
a241cab4eccd43b83e7dda6e6fa3faf36064be10
|
[] |
no_license
|
BernhardKonrad/qlexdatr_coverage
|
1042d88e27bf2d28af65d9e72bde8abcc343deb4
|
bdb67ee429daa6e2b996722fb665c70dd018e5d4
|
refs/heads/master
| 2016-09-01T06:41:43.496010
| 2016-02-23T12:22:43
| 2016-02-23T12:22:43
| 50,470,488
| 2
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 4,228
|
r
|
consistency_movement.R
|
library(qlexdatr)
library(lexr)
library(tidyr)
library(spa)
library(dplyr)
library(ggplot2)
QLEX <- input_lex_data("qlexdatr")
QLEX_DETECT_DATA <- lexr::make_detect_data(QLEX)
SECTIONS_FROM_TO <- QLEX_DETECT_DATA$distance
distance_sections <- function(sectionA, sectionB) {
# Returns pairwise distance between sections
sectionA <- as.character(sectionA)
sectionB <- as.character(sectionB)
stopifnot(length(sectionA) == length(sectionB))
res <- vector(mode="integer", length=length(sectionA))
for (i in 1:length(res)) {
if (is.na(sectionA[i]) | is.na(sectionB[i])) {
res[i] = NA
} else {
res[i] <- SECTIONS_FROM_TO %>%
filter(SectionFrom == sectionA[i], SectionTo == sectionB[i]) %>%
select(Distance) %>%
as.integer()
}
}
res
}
stopifnot(0 == distance_sections("S01", "S01"))
stopifnot(c(0, 0) == distance_sections(c("S01", "S01"), c("S01", "S01")))
QLEX_DETECTION <- QLEX_DETECT_DATA$detection %>%
dplyr::left_join(QLEX_DETECT_DATA$interval, by = c("IntervalDetection" = "Interval"))
QLEX_DETECTION %>%
filter(as.character(Capture) == "F001") %>%
ggplot(aes(x = DateTime, y = as.numeric(Section))) +
geom_point() +
geom_line()
glimpse(QLEX_DETECTION)
# mutate(TimeDiff = DayteTime - lag(DayteTime)) %>%
QLEX_DETECTION %<>%
# filter(as.character(Capture) < "F003") %>%
# droplevels() %>%
group_by(Capture) %>%
mutate(TimeDiff = IntervalDetection - lag(IntervalDetection)) %>%
mutate(LocationDist = distance_sections(Section, lag(Section))) %>%
filter(!is.na(TimeDiff)) %>%
ungroup() %>%
mutate(consistent = LocationDist <= TimeDiff) %>%
rowwise %>%
mutate(consistent_val = max(-1, as.integer(LocationDist - TimeDiff)))
glimpse(QLEX_DETECTION)
QLEX_DETECTION %>%
ggplot(aes(x = as.integer(TimeDiff), y = LocationDist)) +
geom_abline(intercept = 0, slope = 1, size = 2, color = "red") +
stat_sum(aes(size = ..n..), geom = "point") +
scale_size_area(max_size = 10) +
xlim(0, 15) +
ylim(0, 15) +
annotate("text", label = "Inconsistent movement", x = 3, y = 8, size=5)
QLEX_DETECTION %>%
ggplot(aes(x = DateTime, y = as.numeric(Section))) +
geom_line() +
geom_point(aes(color = consistent), size = 5) +
facet_wrap(~ Capture)
QLEX_DETECTION %>%
summarise(frac_consistent = sum(consistent) / n()) %>%
summarize(grand_mean = mean(frac_consistent))
QLEX_DETECTION %>%
ggplot(aes(x = consistent_val, fill = consistent)) +
geom_histogram(binwidth = 1)
QLEX_DETECTION %<>%
group_by(Capture) %>%
mutate(n_obs = length(DateTime),
n_consistent = sum(consistent),
perc_consistent = sum(consistent)/length(consistent),
mean_consistent_val = mean(consistent_val),
max_consistent_val = max(consistent_val),
median_consistent_val = quantile(consistent_val, 0.5)
) %>%
ungroup()
QLEX_DETECTION %>%
ggplot(aes(x = perc_consistent, y = reorder(Capture, perc_consistent))) +
geom_point(aes(size = n_obs, color = max_consistent_val))
QLEX_DETECTION %>%
ggplot(aes(x = perc_consistent, y = reorder(Capture, max_consistent_val))) +
geom_point(aes(size = n_obs, color = max_consistent_val))
QLEX_DETECTION %>%
filter(perc_consistent == 1) %>%
ggplot(aes(x = DateTime, y = as.numeric(Section))) +
geom_line() +
geom_point(size = 5) +
facet_wrap(~ Capture)
#We see that these `r QLEX_DETECTION %>% filter(perc_consistent == 1) %>% nrow()` fish are perfectly consistent, great!
### Fish with largest `consistent_val`, that is, the most inconsistent
QLEX_DETECTION %>%
filter(max_consistent_val >= max(QLEX_DETECTION$consistent_val) - 2) %>%
ggplot(aes(x = DateTime, y = as.numeric(Section))) +
geom_line(aes(size = consistent_val)) +
geom_point(aes(size = 5, color = DateTime)) +
facet_wrap(~ Capture, ncol = 2)
QLEX_DETECTION %>%
filter(max_consistent_val >= max(QLEX_DETECTION$consistent_val) - 2) %>%
rowwise() %>%
mutate(my_str = if (consistent_val > 0) as.character(consistent_val) else "") %>%
ggplot(aes(x = DateTime, y = as.numeric(Section))) +
geom_line(aes(size = consistent_val)) +
geom_point(aes(size = 5)) +
geom_text(aes(label = my_str), hjust = 1.5, size = 8) +
facet_wrap(~ Capture)
|
747375192e4dc6b0f553f9ebdfd661ce625b886d
|
af0b645477bc7708b2924fc7672cf2c4d3775d4e
|
/R/simulate_example_evol_models.R
|
e076b42926a35c05409e16888e014b1a4b5f347a
|
[
"CC-BY-4.0"
] |
permissive
|
meireles/link_spectra_to_tree_of_life
|
f6e76bef09053b3e69d7512442a2a47d31209b31
|
cb7edc1b330da7dea37dbf80e9ee3cf53bd473be
|
refs/heads/master
| 2020-04-08T10:27:47.212454
| 2018-12-07T00:47:16
| 2018-12-07T00:47:16
| 159,269,934
| 1
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,753
|
r
|
simulate_example_evol_models.R
|
#' Simulate a single realization of the OU process
#'
#' @param sig2 rate of the Wiener process
#' @param alpha strength of the mean reversion
#' @param theta mean longrun
#' @param init initial value
#' @param time over which the process unfolds
#' @param n number of time slices. integer. NULL defaults to 100
ou_sim = function(sig2, alpha, theta, init, time = 1, n = NULL){
n = ifelse(is.null(n),max(time * 100), n)
dt = time / n
dw = rnorm(n, 0, sqrt(dt))
pull = function(theta, x, dt){ alpha * (theta - x) * dt}
y = c(init, rep(NA, n - 1))
for (i in 2 : n){
y[i] = y[i - 1] + pull(theta, y[i - 1], dt) + sig2 * dw[i - 1]
}
setNames(y, nm = seq(0, time, length.out = n))
}
#set.seed(08282018)
n = 3
brownian = sapply(1:n, function(x){
ou_sim(sig2 = 0.5,
alpha = 0,
theta = 1,
init = 0,
time = 2,
n = 100)
})
ou_weak = sapply(1:n, function(x){
ou_sim(sig2 = 0.5,
alpha = log(2) / 2,
theta = 2,
init = 0,
time = 2,
n = 100)
})
ou_strong = sapply(1:n, function(x){
ou_sim(sig2 = 0.5,
alpha = log(2) * 3,
theta = 2,
init = 0,
time = 2,
n = 100)
})
png("figures/example_evol_model.png", width = 9, height = 3, units = "in", res = 800)
par(mfrow = c(1, 3))
yrange = range(brownian, ou_weak, ou_strong)
matplot(brownian, type = "l", lty = 1, lwd = 2,
ylab = "trait", xlab = "time",
main = "BM (random wiggle)", ylim = yrange,
col = c("black", "blue", "orange") )
legend("topleft", legend = "rate = 0.2",
fill = NULL, border = NA, bty = "n", adj = 0.25)
mtext("a", side = 1, adj = 0.01, outer = T, font = 2, line = -1.5)
matplot(ou_weak, type = "l", lty = 1, lwd = 2,
ylab = "trait", xlab = "time",
main = "OU (wiggle + weak pull)", ylim = yrange,
col = c("black", "blue", "orange"))
arrows(116, 2, 106, 2, xpd = TRUE, lwd = 2.5, cex = 1, length = 0.1, col = "red")
legend("topleft", legend = c("rate = 0.2", "pull = 0.35"),
fill = NULL, border = NA, bty = "n", adj = 0.25)
mtext("b", side = 1, adj = 0.35, outer = T, font = 2, line = -1.5)
matplot(ou_strong, type = "l", lty = 1, lwd = 2,
ylab = "trait", xlab = "time",
main = "OU (wiggle + strong pull)", ylim = yrange,
col = c("black", "blue", "orange"))
arrows(116, 2, 106, 2, xpd = TRUE, lwd = 2.5, cex = 1, length = 0.1, col = "red")
legend("topleft", legend = c("rate = 0.2", "pull = 2.1"),
fill = NULL, border = NA, bty = "n", adj = 0.25)
mtext("c", side = 1, adj = 0.70, outer = T, font = 2, line = -1.5)
dev.off()
|
11c994b8e84a5b1f312dc978aebad62fa89c8322
|
2a811f8be6af323af6d0fe823a3f1e62b2b79a46
|
/R/image.hglasso.R
|
fa5d5458d7ab4d51b136f6d6139785c27a5cc30f
|
[] |
no_license
|
cran/hglasso
|
681f0fe36f1a10c5e53dbf144d144b13a4a5111d
|
da7e8d5f000b176dffff2d68d5a0118ea78e1d24
|
refs/heads/master
| 2022-06-01T20:17:07.281739
| 2022-05-13T07:20:02
| 2022-05-13T07:20:02
| 18,368,817
| 2
| 1
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,234
|
r
|
image.hglasso.R
|
image.hglasso <-
function(x,...){
# Initialize some variables
Z <- x$Z
V <- x$V
diag(Z) <- 0
diag(V) <- 0
Z[which(abs(Z)<1e-4)] <- 0
Z[which(Z<0)] <- -1
Z[which(Z>0)] <- 1
V[which(abs(V)<1e-4)] <- 0
V[which(V<0)] <- -1
V[which(V>0)] <- 1
rgb.num=col2rgb("orange")
colororange=rgb(rgb.num[1],rgb.num[2],rgb.num[3],150,maxColorValue=256)
rgb.num=col2rgb("blue")
colorblue=rgb(rgb.num[1],rgb.num[2],rgb.num[3],100,maxColorValue=256)
colZ <- colV <- c(colorblue,"white",colororange)
if(sum(Z<0)==0){
colZ <- c("white",colororange)
}
if(sum(V<0)==0){
colV <- c("white",colororange)
}
if(sum(Z>0)==0){
colZ <- c(colorblue,"white")
}
if(sum(V>0)==0){
colV <- c(colorblue,"white")
}
if(sum(Z>0)==0 && sum(Z<0)==0){
colZ <- c("white")
}
if(sum(V>0)==0 && sum(V<0)==0){
colV <- c("white")
}
p <- nrow(Z)
dev.new(width=10,height=5)
set.panel(1,2)
par(oma=c(0,0,0,3))
image(t(Z),col=colZ,axes=TRUE,xaxt='n',yaxt='n',main="Z",cex.main=2,...)
image(t(V),col=colV,axes=TRUE,xaxt='n',yaxt='n',main="V",cex.main=2,...)
par(oma=c(0,0,0,1))
temp<-matrix(c(-max(abs(x$Z),abs(x$V)),max(abs(x$Z),abs(x$V)),0,0),2,2)
image.plot(temp,col=c(rep(colorblue,15),"white",c(rep(colororange,15))),horizontal=FALSE,legend.only=TRUE)
invisible(temp)
}
|
22936ad08b5d8a0a1e8d89ee74f233efadc687ea
|
5355041c27c2d9bda28e216c8d958e20ef406b55
|
/p7/reto1.R
|
af160a853b79eb9cb9e354539ffa19908047bc47
|
[] |
no_license
|
JuanPabloRosas/R-paralelo
|
a5e1e7ff28d2d119bc5ed04ac6168369476df684
|
5927dddff2ead2a8a901d27954e6820fff8e44d8
|
refs/heads/master
| 2021-01-02T23:05:20.766335
| 2017-12-12T09:42:12
| 2017-12-12T09:42:12
| 99,465,353
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 4,692
|
r
|
reto1.R
|
library(lattice)
library(reshape2)
library(plot3D)
library(rgl)
d <- data.frame()
mov <- data.frame()
#---------------------------------------------------------------------------------
g <- function(x, y) {
func1 <- ((x + 0.5)^4 - 30 * x^2 - 20 * x + (y + 0.5)^4 - 30 * y^2 - 20 * y)/100
func2 <- (x^2 + y^2)^(1/3)
func3 <- sin(x)*sin(y)^2
func4 <- -sin(sqrt(x^2 + y^2)/(x^2 + y^2))
return(-func1)
}
#---------------------------------------------------------------------------------
low <- -6
high <- 5
step <- 0.1
replicas <- 100
x <- seq(low, high, length.out=45)
y <- x
#----------------------------DIBUJA CADA PUNTO-----------------------------------------------------
dibuja <-function(t,a,b){
library(lattice)
z <-outer(x,y,g)
d <- data.frame()
for(i in x){
for(j in y){
d <- rbind(d,c(i,j,g(i,j)))
}
}
names(d) <- c("x", "y", "z")
if(t <= 9){
nombre <- paste0("/home/pabloide/Documentos/3 Semestre/R_paralelo/p7/reto1/p7_00", t, ".png", sep="")
}
else if(t >= 100){
nombre <- paste0("/home/pabloide/Documentos/3 Semestre/R_paralelo/p7/reto1/p7_", t, ".png", sep="")
}
else{
nombre <- paste0("/home/pabloide/Documentos/3 Semestre/R_paralelo/p7/reto1/p7_0", t, ".png", sep="")
}
png(nombre, width=700, height=500)
plot(levelplot(z ~ x * y, data = d), main ="t")
trellis.focus("panel", 1, 1, highlight=FALSE)
lpoints(a,b, pch=19, col="blue", cex=1)
trellis.unfocus()
graphics.off()
}
#---------------------------------------------------------------------------------
replica <- function(t) {
curr_x <- runif(1, low, high)
curr_y <- runif(1, low, high)
curr <- c(curr_x, curr_y)
bestval <- g(curr_x, curr_y)
bestpos <- c(curr_x, curr_y)
for (tiempo in 1:t) {
dibuja(tiempo,curr_x,curr_y)
delta <- runif(1, 0, step)
op = c(curr_x - delta, curr_y, curr_x + delta, curr_y, curr_x, curr_y - delta, curr_x, curr_y + delta)
posibles = numeric()
for (i in 1:4){
posibles <- c(posibles, g(op[2*i - 1], op[2*i]))
}
mejor <- which.max(posibles)
nuevo = posibles[mejor]
if (nuevo > bestval) {
curr_x <- op[(2*mejor - 1)]
curr_y <- op[(2*mejor)]
curr <- c(curr_x,curr_y)
bestval <- nuevo
}
}
return(curr)
}
suppressMessages(library(doParallel))
registerDoParallel(makeCluster(detectCores() - 1))
for (pot in 2:4) {
tmax <- 10^pot
output <- data.frame()
resultados <- foreach(i = 1, .combine=c) %dopar% replica(tmax)
resultados <- data.frame(resultados)
colnames(resultados) <- c("x")
o <- 1
while(TRUE){
indice <- o * 2
output <- rbind(output, c(resultados$x[indice - 1] , resultados$x[indice]))
o <- o + 1
if(o == 101)
{
break
}
}
colnames(output) <- c("x","y")
mejores <- data.frame()
for(z in 1:100){
mejores <- rbind(mejores, g(output$x[z],output$y[z]))
}
colnames(mejores) <- c("z")
mejor <- which.max(mejores$z)
z <-outer(x,y,g)
d <- data.frame()
for(i in x){
for(j in y){
d <- rbind(d,c(i,j,g(i,j)))
}
}
names(d) <- c("x", "y", "z")
colnames(output) <- c("x","y")
png(paste0("/home/pabloide/Documentos/3 Semestre/R_paralelo/p7/p7_densidad.png",tmax, sep=""), width=700, height=500)
f2 <- kde2d(output$x , output$y, z ,n = 100, lims = c(-6, 6, -6, 6))
image(f2)
filled.contour(f2,plot.axes = {points(10, 10) },color.palette=colorRampPalette(c('white','blue','darkblue','yellow','red','darkred')))
graphics.off()
png(paste0("/home/pabloide/Documentos/3 Semestre/R_paralelo/p7/p7_3d.png", sep=""), width=700, height=500)
persp(x, y, z, shade=0.2, col='orange', theta=40, phi=30)
graphics.off()
png(paste0("/home/pabloide/Documentos/3 Semestre/R_paralelo/p7/p7_", tmax, ".png", sep=""), width=700, height=500)
plot(levelplot(z ~ x * y, data = d))
trellis.focus("panel", 1, 1, highlight=FALSE)
lpoints(output$x,output$y, pch=19, col="blue", cex=1)
trellis.unfocus()
trellis.focus("panel", 1, 1, highlight=FALSE)
lpoints(output$x[mejor],output$y[mejor], pch=19, col="red", cex=1)
trellis.unfocus()
graphics.off()
}
stopImplicitCluster()
#----------------------Plot 3D manipulable---------------------------------
#persp3d(x,y,z, axes=TRUE,scale=3, box=TRUE,xlab="X-value", ylab="Y-value", zlab="Z-value",
# main="Función 1",nticks=5, ticktype="detailed", col = "yellow")
#browseURL(paste("file://", writeWebGL(dir=file.path(tempdir(), "webGL"), width=500), sep=""))
#-----------------------------------------------------------------------
|
6cf95931235a95d89d51a29976f5cd66550c40e8
|
b0f29706f754d6ada354a0c34e692455dc88d98f
|
/R files/R function to obtain empirical MSE under imperfect individual-level ranking.R
|
3e6ac7bbc01c2e9099554387dfea0eb44f66a067
|
[] |
no_license
|
mumuwsmu/Ranked-Set-Sampling-Binary-Outcome
|
dcb47ef26ad1b289e5601929a934abbdcb6a4470
|
36e2fbc3cf033de0f12a61f162aed44bb7abea6b
|
refs/heads/master
| 2020-07-03T07:09:24.354488
| 2019-08-12T02:50:29
| 2019-08-12T02:50:29
| 201,832,971
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 3,584
|
r
|
R function to obtain empirical MSE under imperfect individual-level ranking.R
|
library("gaussquad")
library("lme4")
# rank individual level only #
MseNormid.e=function(ji,kji,hji,bji.sd,r.right,mu,a1,G,Gau.ord)
{
delta.NP=rep(0,G)
delta.PL=rep(0,G)
delta.MLE=rep(0,G)
orthonormal.rules=hermite.h.quadrature.rules(Gau.ord, TRUE )
g.h.q=as.vector(unlist(orthonormal.rules[Gau.ord]))
t=g.h.q[1:Gau.ord]
w=g.h.q[(Gau.ord+1):(2*Gau.ord)]
i=1
for(i in 1:G){
# Sampling control group#
h.pr=1
p0=rep(0,ji)
b0=rnorm(ji,mean=0,sd=bji.sd)
p0=1/(1+exp(-mu-b0))
y0=matrix(rep(0,ji*kji), nrow=ji)
j=1
for(j in 1:ji) {
y=matrix(rep(0,kji),nrow=hji)
for(h.pr in 1:hji)
{
y.hpr=matrix(rbinom(kji, 1, p0[j]),nrow=hji)
r=matrix(runif(kji),nrow=hji)
x.hpr=abs((r>r.right)-y.hpr) # r.right is the prob of judging correctly #
x.horder=apply(x.hpr, 2, order,decreasing=TRUE) # rank based on x #
y[h.pr,]=diag(y.hpr[x.horder[h.pr,],1:(kji/hji)])
}
y0[j,]=as.vector(t(y))
}
# Sampling treatment group#
h.pr=1
p1=rep(0,ji)
b1=rnorm(ji,mean=0,sd=bji.sd)
p1=1/(1+exp(-mu-a1-b1))
y1=matrix(rep(0,ji*kji), nrow=ji)
j=1
for(j in 1:ji) {
y=matrix(rep(0,kji),nrow=hji)
for(h.pr in 1:hji)
{
y.hpr=matrix(rbinom(kji, 1, p1[j]),nrow=hji)
r=matrix(runif(kji),nrow=hji)
x.hpr=abs((r>r.right)-y.hpr)
x.horder=apply(x.hpr, 2, order,decreasing=TRUE) # rank based on x #
y[h.pr,]=diag(y.hpr[x.horder[h.pr,],1:(kji/hji)])
}
y1[j,]=as.vector(t(y))
}
# NP estimator #
y0.sumk=apply(y0,1,sum)
y1.sumk=apply(y1,1,sum)
delta.NP[i]=mean(log((y1.sumk+0.5)/(kji-y1.sumk+0.5)))-mean(log((y0.sumk+0.5)/(kji-y0.sumk+0.5)))
# PL estimator #
y=c(as.vector(t(y0)),as.vector(t(y1)))
clust=rep(1:(2*ji),rep(kji,(2*ji)))
treat=c(rep(0,ji*kji),rep(1,ji*kji))
mod=glmer(y ~ treat +(1| clust), family=binomial,control=glmerControl(optimizer="bobyqa"),nAGQ=10)
delta.PL[i]=as.numeric(fixef(mod)[2])
# MLE estimator #
h.rank=1:hji
min.fn=function(x)
{ml.mu=x[1]
ml.a1=x[2]
ml.sd.b=x[3]
j=1
eqn0=rep(0,ji)
eqn1=rep(0,ji)
for(j in 1:ji){
m=1
gauss.qudr0=rep(0,Gau.ord)
gauss.qudr1=rep(0,Gau.ord)
h.ind=1
y0.sumhk=rep(0,hji)
y1.sumhk=rep(0,hji)
for(h.ind in 1:hji) {
y0.sumhk[h.ind]=sum(y0[j,(kji/hji*(h.ind-1)+1):(kji/hji*h.ind)])
}
h.ind=1
for(h.ind in 1:hji) {
y1.sumhk[h.ind]=sum(y1[j,(kji/hji*(h.ind-1)+1):(kji/hji*h.ind)])
}
for(m in 1:Gau.ord) {
gauss.qudr0[m]=w[m]*exp(t[m]^2/2+sum(y0.sumhk*log((1-pbinom(h.rank-1,hji,1/(1+exp(-ml.mu-ml.sd.b*t[m]))))/pbinom(h.rank-1,hji,1/(1+exp(-ml.mu-ml.sd.b*t[m]))))
+kji/hji*log(pbinom(h.rank-1,hji,1/(1+exp(-ml.mu-ml.sd.b*t[m]))))))
gauss.qudr1[m]=w[m]*exp(t[m]^2/2+sum(y1.sumhk*log((1-pbinom(h.rank-1,hji,1/(1+exp(-ml.mu-ml.a1-ml.sd.b*t[m]))))/pbinom(h.rank-1,hji,1/(1+exp(-ml.mu-ml.a1-ml.sd.b*t[m]))))
+kji/hji*log(pbinom(h.rank-1,hji,1/(1+exp(-ml.mu-ml.a1-ml.sd.b*t[m]))))))
}
eqn0[j]=log(sum(gauss.qudr0))
eqn1[j]=log(sum(gauss.qudr1))
}
-sum(eqn0)-sum(eqn1)
}
delta.MLE[i]=optim(c(mu,a1,bji.sd), min.fn)$par[2]
}
MSE.PL=sum((delta.PL-a1)^2/G)
MSE.MLE=sum((delta.MLE-a1)^2/G)
MSE.NP=sum((delta.NP-a1)^2/G)
return(c(MSE.MLE,MSE.PL,MSE.NP))
}
|
1ec9d4fb043a7413ffee8a8a62ed28bb52f268c6
|
7b61b0369dbedbf35cbdf3f59a95468a5e324555
|
/R/wnm_get_cutlines.R
|
d73e71016d94bc87c89eb41291e73b2942bc779b
|
[] |
no_license
|
jaytimm/wnomadds
|
a3aab2d0c3fb6a721e2ba235cca4b460d6575e53
|
f7b0697c95cd7e501d20c7467ac2cd5d242c01f2
|
refs/heads/master
| 2020-03-21T18:46:31.626002
| 2019-06-19T18:24:12
| 2019-06-19T18:24:12
| 138,912,294
| 6
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,125
|
r
|
wnm_get_cutlines.R
|
#' Extract cut line coordinates
#'
#' A simple function for extracting cutting line coordinates and roll call polarity from an object of class `nomObj` via the `wnominate` package.
#'
#' @name wnm_get_cutlines
#' @param x A nomObj via wnominate::wnominate output
#' @param rollcall_obj A rollcall object from pscl package
#' @param arrow_length A numeric value specifying arrow length for subsequent visualization
#' @return A data frame
#Modified from wnominate package
#' @export
#' @rdname wnm_get_cutlines
wnm_get_cutlines <- function(x,
arrow_length = 0.05,
rollcall_obj,...) {
dims <- c(1,2)
row.names(x$rollcalls) <- dimnames(rollcall_obj$votes)[[2]]
constrained <- ((abs(x$rollcalls[,"spread1D"]) > 0.0 | abs(x$rollcalls[,"spread2D"]) > 0.0)
& (x$rollcalls[,"midpoint1D"]**2 + x$rollcalls[,"midpoint2D"]**2) < .95)
cutlineData <- cbind(x$rollcalls[constrained,paste("midpoint",dims[1],"D",sep="")],
x$rollcalls[constrained,paste("spread",dims[1],"D",sep="")],
x$rollcalls[constrained,paste("midpoint",dims[2],"D",sep="")],
x$rollcalls[constrained,paste("spread",dims[2],"D",sep="")])
cutlineData <- na.omit(cutlineData)
ns <- na.omit(row.names(x$rollcalls)[constrained])
cuts <- apply(cutlineData, 1, add.cutline,
weight=x$weights[dims[2]]/x$weights[dims[1]])
names(cuts) <- ns
cuts <- data.table::rbindlist(cuts, id = 'Bill_Code')
cuts <- cuts[complete.cases(cuts),]
cuts$id <- rep(1:2, length(unique(cuts$Bill_Code)))
cuts <- data.table::melt(cuts, c('Bill_Code','id'), c('x','y'),
variable.name="variable", value.name="value")
cuts <- data.table::dcast (cuts,
Bill_Code ~ paste0(variable,"_",id),
value.var = "value")
cuts <- cuts[, c('Bill_Code', 'x_1','y_1', 'x_2', 'y_2')]
cuts$pols <- get_polarity(x, rollcall_obj, cuts)
fin_cuts <- get_arrows (cuts, arrow_length = arrow_length)
subset(fin_cuts, select = -c(pols))
}
|
5a265492d5cef214c0056296c29ba33682682ae1
|
e95b967ddb69c7619f59fca09707051e830688b7
|
/wrangle-data.R
|
97383431e51d532743b2df823b32117faf6ad054
|
[] |
no_license
|
geoseyden/murders
|
9c552a43abf4c7a916060665ae99f4382fdab3ab
|
b6fad832dbf25937ee6e89b1495ce093caf18a56
|
refs/heads/master
| 2022-04-25T18:04:43.092372
| 2020-04-27T16:06:44
| 2020-04-27T16:06:44
| 259,355,518
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 176
|
r
|
wrangle-data.R
|
library(tidyverse)
murders<- read_csv("data/murders.csv")
murders<- murders %>% mutate(region= factor(region), rate=total/population *10^5)
save(murders,file="rda/murders.rda")
|
8e9e9b6d372581070531ad72fcc04709fcbed61e
|
bf8722b93301e132af8fc09c7774ef10ffaaed1f
|
/RR/dothi (17).R
|
3ca83f623146bcfd8c62e977eb14843d5fb40e4a
|
[] |
no_license
|
phantheminhchau1/doan_nnltR
|
b1bf3ed84ab57f674664624561be3dcef07c3d6c
|
2cdf8ac443d0bd265dd72909b2e5bbb11e4f7845
|
refs/heads/main
| 2023-06-15T09:22:28.372293
| 2021-07-13T08:54:44
| 2021-07-13T08:54:44
| 385,331,105
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 359
|
r
|
dothi (17).R
|
df <- read.csv("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/06-30-2021.csv")
df <-df[!(df1$Country_Region != "Vietnam"),]
ggplot(data = df,col="#AA4371",
aes(x = reorder(Province_State, Confirmed), y = Confirmed))+
geom_bar(stat = "identity",fill="steelblue")+
coord_flip()
|
fe345472a7e9b3086812a234d7c135b108e832d3
|
2a7e77565c33e6b5d92ce6702b4a5fd96f80d7d0
|
/fuzzedpackages/MatchIt/R/nnmatch.R
|
3bf08e558df6a5e4493ae666ff4ec5c569e021eb
|
[] |
no_license
|
akhikolla/testpackages
|
62ccaeed866e2194652b65e7360987b3b20df7e7
|
01259c3543febc89955ea5b79f3a08d3afe57e95
|
refs/heads/master
| 2023-02-18T03:50:28.288006
| 2021-01-18T13:23:32
| 2021-01-18T13:23:32
| 329,981,898
| 7
| 1
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,754
|
r
|
nnmatch.R
|
nn_match <- function(treat, ord, ratio = 1, replace = FALSE, discarded, distance = NULL, ex = NULL, caliper.dist = NULL,
caliper.covs = NULL, caliper.covs.mat = NULL, mahcovs = NULL, mahSigma_inv = NULL, disp_prog = FALSE) {
n1 <- sum(treat == 1)
ind <- seq_along(treat)
ind1 <- ind[treat == 1]
ind0 <- ind[treat == 0]
if (!is.null(ex)) {
ex1 <- ex[treat == 1]
ex0 <- ex[treat == 0]
}
if (!is.null(distance)) {
d1 <- distance[treat == 1]
d0 <- distance[treat == 0]
}
max.ratio <- max(ratio)
mm <- matrix(NA_integer_, nrow = n1, ncol = max.ratio)
matched <- discarded
ord_ <- ord[!discarded[ord]] #Only non-discarded
if (disp_prog) {
pb <- txtProgressBar(min = 0, max = sum(ratio), style = 3)
on.exit(close(pb))
k <- -1
}
for (r in seq_len(max.ratio)) {
for (ord_i in ord_[ratio[ord_] >= r]) {
if (disp_prog) {
k <- k + 1
setTxtProgressBar(pb, k)
}
c.eligible <- !matched & treat == 0
if (!replace) {
if (!any(c.eligible)) break
}
else if (r > 1) {
#If replace = T and r > 1, don't rematch to same control unit
c.eligible[mm[ord_i, seq_len(r - 1)]] <- FALSE
}
if (!any(c.eligible)) next
if (!is.null(ex)) {
c.eligible[c.eligible][ex0[c.eligible] != ex1[ord_i]] <- FALSE
}
if (!any(c.eligible)) next
#Get distances among eligible and apply caliper
ps.diff <- NULL
#PS caliper
if (length(caliper.dist) > 0) {
ps.diff <- abs(d1[ord_i] - distance[c.eligible])
c.eligible[c.eligible][ps.diff > caliper.dist] <- FALSE
}
if (!any(c.eligible)) next
#Covariate caliper
if (length(caliper.covs) > 0) {
for (x in names(caliper.covs)) {
calcov.diff <- abs(caliper.covs.mat[ind1[ord_i], x] - caliper.covs.mat[c.eligible, x])
c.eligible[c.eligible][calcov.diff > caliper.covs[x]] <- FALSE
if (!any(c.eligible)) break
}
}
if (!any(c.eligible)) next
if (length(mahcovs) == 0) {
#PS matching
distances <- if (is.null(ps.diff)) abs(d1[ord_i] - distance[c.eligible]) else ps.diff
}
else {
#MD matching
distances <- sqrt(mahalanobis(mahcovs[c.eligible, ,drop = FALSE],
mahcovs[ind1[ord_i],],
cov = mahSigma_inv, inverted = TRUE))
}
#Assign match
##Resolve ties by selecting the first unit
mm[ord_i, r] <- which(c.eligible)[which.min(distances)]
if (!replace) matched[mm[ord_i, r]] <- TRUE
}
}
if (disp_prog) {
setTxtProgressBar(pb, sum(ratio))
}
return(mm)
}
|
bd2aa8708e6649ecbc269666acd9a9277c9d4af9
|
919a89d08785bc50616da8dbda25c7aa526a15e3
|
/correlation-heatmap/draw_coverage.R
|
ed03b45df021491b5b86a031ec928e367cf9a551
|
[] |
no_license
|
pandaspa/R_RNA_seq
|
9e578803378149f51e4a1aeae30405fa978ad51d
|
966de1916ec49d41b58cdac8e7b9655a7ea9e0b6
|
refs/heads/master
| 2023-03-21T00:36:51.078426
| 2020-01-21T01:50:05
| 2020-01-21T01:50:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 178,411
|
r
|
draw_coverage.R
|
data<-c(25.62,16.63,12.80,10.14,8.28,7.30,6.23,5.46,4.80,2.72)
data<-data
data <- matrix(data,nrow=1)
colnames(data) <- c('0-10','10-20','20-30','30-40','40-50','50-60','60-70','70-80','80-90','90-100')
den <- density(c(7.141,7.355,4.527,6.307,2.753,0.92,3.387,0.876,0.261,0.744,0.217,7.312,1.479,5.559,5.259,7.725,0.307,2.012,0.432,0.438,3.965,2.112,5.767,0.874,0.585,1.608,1.045,1.495,4.274,1.288,0.979,0.394,0.955,3.546,0.21,2.484,9.075,1.625,3.706,4.32,2.926,0.339,5.425,1.378,1.417,1.889,2.759,6.157,2.757,4.772,0.349,0.589,7.76,1.852,1.429,7.148,6.011,1.131,0.198,3.243,3.833,0.641,5.224,2.448,0.576,7.291,4.656,2.228,6.883,0.968,5.91,0.742,8.204,8.668,4.514,1.547,0.03,1.08,0.2,1.446,1.672,1.961,1.685,5.039,1.089,1.102,3.077,0.521,0.335,0.903,1.546,2.091,6.122,3.103,1.637,2.678,6.428,0.521,0.172,6.421,3.129,1.093,6.834,3.664,4.418,2.142,2.681,0.204,6.253,2.745,0.395,0.873,2.348,4.386,5.657,4.771,2.255,0.663,1.405,5.379,6.721,1.233,5.944,2.871,8.765,6.998,3.163,7.506,0.188,0.597,3.176,0.812,9.861,0.736,5.014,7.279,4.621,2.719,4.688,2.782,1.251,4.737,7.68,0.756,3.749,2.526,1.546,1.469,3.903,0.922,8.004,0.932,5.95,1.531,0.31,0.682,9.842,0.988,0.986,6.057,3.463,1.186,7.945,2.397,6.875,8.144,3.021,0.221,0.776,8.851,2.47,7.646,1.284,4.051,2.147,8.641,2.85,5.561,4.259,7.13,6.319,1.126,3.992,1.403,4.083,3.643,0.526,4,0.931,1.978,2.74,1.057,2.361,2.42,2.148,9.148,1.892,6.921,1.675,2.296,0.437,6.94,0.589,4.013,5.853,8.674,3.807,0.553,2.601,1.08,8.014,3.747,8.93,1.034,2.937,8.659,0.78,0.13,4.409,1.038,0.375,3.074,2.16,7.365,0.598,4.187,3.887,1.678,1.528,8.748,1.538,0.164,0.822,8.275,1.262,3.201,5.184,0.732,8.312,4.171,6.317,2.074,3.896,7.437,2.531,0.307,0.729,0.379,2.735,3.336,2.799,3.117,1.321,6.08,9.691,4.243,8.776,4.177,2.467,3.662,1.139,2.601,2.62,3.356,4.631,2.208,4.443,0.302,7.284,0.31,2.474,8.972,8.896,7.005,3.781,0.189,0.166,4.657,0.456,5.823,3.482,0.448,1.795,2.112,0.47,0.795,8.722,1.307,0.521,0.271,6.178,1.643,2.959,3.172,0.998,5.924,8.432,5.233,6.494,4.01,2.692,6.251,1.614,1.858,2.671,8.482,5.127,0.381,4.447,0.358,0.599,1.181,8.103,1.87,6.542,1.433,4.206,0.392,6.109,1.445,0.719,8.532,6.99,4.402,0.328,2.173,0.162,4.211,3.214,4.646,4.813,0.394,1.306,1.832,6.804,4.09,5.04,2.666,1.108,2.193,6.021,1.462,0.279,7.593,0.623,4.721,5.385,6.279,1.483,3.459,0.819,0.616,0.442,5.855,5.105,0.197,0.501,6.006,4.273,5.148,3.367,1.878,2.919,7.269,2.054,0.037,7.975,2.957,8.137,0.861,7.331,5.03,2.96,8.531,2.094,6.113,6.065,6.896,0.104,1.632,6.726,6.981,1.322,9.538,4.278,9.665,2.539,2.286,4.408,8.313,0.751,7.644,5.722,1.165,4.523,0.212,0.114,0.485,2.167,2.152,0.221,4.451,7.662,4.949,1.979,6.848,6.478,1.415,8.79,0.345,3.909,4.487,8.589,3.049,2.432,8.483,3.822,2.953,7.049,4.756,0.345,1.813,5.162,0.219,1.745,0.126,9.292,4.461,5.388,2.114,3.831,4.669,1.833,3.281,0.613,0.894,6.083,5.706,1.167,3.727,3.747,5.607,5.415,2.758,0.787,0.572,7.735,0.812,0.901,7.797,2.594,0.383,0.833,1.146,9.368,5.567,7.717,1.699,2.392,6.859,5.845,3.434,0.785,0.482,7.054,4.31,4.938,1.71,7.023,3.929,1.304,0.689,0.301,1.685,1.305,7.05,1.14,0.381,5.82,2.147,7.329,0.596,8.268,3.786,4.464,2.008,1.535,5.126,0.885,0.987,1.238,6.004,6.181,3.589,6.064,1.11,1.955,2.353,3.28,9.31,7.757,5.412,0.591,8.617,0.184,7.955,0.583,6.833,2.923,5.166,7.615,4.531,0.344,4.809,0.615,2.203,0.284,4.937,4.692,0.665,0.182,4.594,0.413,0.944,7.444,6.439,1.289,2.597,6.281,1.134,2.406,5.396,4.266,0.395,9.242,7.706,1.305,1.39,0.111,1.621,4.727,4.491,1.268,6.141,4.829,0.147,1.545,2.826,7.69,6.648,0.305,5.409,0.676,7.406,3.977,3.562,1.293,1.354,8.103,3.517,1.43,2.018,5.5,2.965,1.229,1.055,2.717,3.14,2.102,1.157,1.228,8.145,6.242,0.334,8.426,0.427,2.301,2.218,7.498,2.205,0.19,2.673,3.65,1.329,6.282,3.102,9.522,9.824,6.138,9.114,1.171,0.473,0.15,2.623,1.672,0.649,0.456,2.737,5.506,0.921,4.224,0.583,4.022,3.274,1.377,0.092,5.109,0.506,4.268,0.468,0.795,5.392,1.034,0.303,0.314,5.22,3.8,0.417,6.47,2.174,3.775,1.729,1.676,6.906,2.909,6.871,5.334,1.252,3.897,5.83,4.897,0.711,8.038,0.756,6.276,0.596,1.429,1.909,0.415,4.161,0.868,1.203,1.535,0.658,5.137,3.315,1.421,8.85,2.552,1.384,5.727,4.342,0.093,6.666,9.805,5.61,4.614,0.214,2.95,1.153,1.093,0.207,2.932,4.858,8.506,0.303,0.269,1.238,5.614,3.608,0.915,1.109,0.469,0.7,7.163,5.335,4.891,7.504,1.248,0.618,6.317,1.505,8.74,4.264,6.912,0.234,1.998,0.263,0.4,4.033,0.257,7.334,4.849,2.978,3.614,6.512,3.425,7.379,7.935,0.292,4.08,6.202,9.036,9.21,7.151,0.78,0.384,9.265,2.18,0.653,1.606,2.425,0.733,0.464,0.81,0.502,5.635,3.857,5.919,0.704,5.669,0.394,0.403,0.484,4.043,1.964,7.652,4.849,4.558,2.999,1.055,3.348,1.139,1.473,0.858,2.716,0.911,0.598,6.203,1.966,0.119,2.283,1.775,2.561,5.312,0.164,2.726,0.998,0.405,8.339,3.091,1.168,1.119,2.533,6.662,0.565,5.355,0.455,0.363,5.023,8.989,1.302,6.579,4.759,2.197,4.934,2.913,4.64,0.798,1.827,6.181,4.603,4.41,7.25,1.44,1.127,4.673,0.751,5.055,1.135,0.605,4.641,3.288,3.664,9.102,0.374,0.227,2.97,1.389,0.855,0.888,3.384,5.843,2.366,0.998,0.285,0.601,7.276,4.62,5.305,2.94,0.817,1.241,5.594,0.368,0.683,2.733,0.156,8.373,1.017,6.987,7.138,2.742,5.778,4.829,1.545,1.913,1.287,2.776,5.903,4.776,3.482,1.756,0.662,1.07,2.381,3.584,0.064,1.318,1.289,5.427,0.38,7.463,1.083,2.174,0.3,0.338,1.369,3.889,2.034,9.302,3.369,2.229,5.156,6.605,8.283,6.835,2.424,7.562,1.927,2.896,0.177,5.855,0.848,2.392,3.583,5.412,8.171,3.741,0.27,2.529,0.159,5.208,3.665,1.319,5.957,0.198,0.46,0.316,8.703,8.164,1.966,2.629,1.135,8.74,0.43,2.392,6.086,1.599,4.913,6.599,0.078,2.486,1.877,0.843,1.214,0.962,4.963,3.567,5.452,4.579,1.681,2.637,0.321,3.148,2.219,0.101,1.028,1.313,0.924,4.247,1.564,3.035,1.673,6.966,0.982,9.509,2.64,0.465,0.261,9,5.857,7.602,4.332,0.888,6.124,3.98,2.29,6.758,5.083,2.966,1.009,2.197,5.218,4.415,1.07,2.403,9.274,7.569,1.332,7.331,2.773,6.405,4.155,3.579,0.153,2.094,5.28,1.32,4.91,4.101,8.159,5.73,1.194,0.13,3.2,6.319,5.795,7.121,5.778,0.073,0.822,0.583,3.568,7.064,0.09,0.209,8.424,8.857,8.097,8.567,3.129,2.642,8.018,0.57,0.276,7.635,0.484,1.479,1.613,1.422,6.905,6.539,1.674,3.872,7.557,4.402,4.539,0.74,3.154,1.023,2.726,4.287,0.881,0.289,0.794,3.659,4.432,0.962,4.847,4.314,4.257,4.778,6.599,1.695,3.12,1.604,2.316,0.52,1.403,7.542,6.42,1.506,2.578,5.085,4.807,2.488,0.439,6.455,0.883,7.36,5.799,3.5,7.034,0.734,4.505,0.572,4.541,7.624,3.722,9.675,4.556,5.022,6.866,0.085,9.66,0.794,1.067,0.838,8.516,5.239,0.6,5.7,0.436,0.847,2.933,4.124,2.569,3.342,0.235,6.145,5.258,4.41,2.867,5.929,2.093,2.76,3.956,0.39,0.201,0.811,8.496,0.424,7.613,6.586,0.752,7.911,1.616,1.297,5.873,0.713,4.901,1.189,2.375,0.259,9.259,6.156,0.853,2.87,2.544,5.89,1.208,2.695,1.411,0.656,0.242,0.205,7.821,0.58,3.775,0.294,4.977,5.455,1.401,2.005,3.457,3.731,5.042,2.628,3.729,1.133,2.971,0.437,0.294,3.483,4.59,0.658,1.562,2.088,5.782,5.233,2.508,3.001,0.213,1.13,7.983,1.91,4.666,1.428,1.096,0.785,2.104,2.442,3.988,3.347,0.193,9.301,0.925,2.264,3.602,0.285,5.445,3.601,3.613,0.421,3.407,2.011,3.9,7.541,0.089,1.861,9.306,1.836,3.177,3.006,4.419,1.846,0.387,6.561,5.798,2.938,6.967,2.725,8.708,0.616,2.93,0.184,0.476,0.986,7.877,8.996,0.065,0.179,2.867,8.169,1.602,5.987,0.216,5.179,0.435,3.517,4.511,1.873,1.477,6.222,0.182,3.865,0.651,2.525,2.006,5.377,0.363,2.029,9.507,0.771,4.919,3.239,1.452,5.394,7.874,9.062,0.446,3.942,4.125,1.623,1.14,8.661,7.266,3.015,1.261,4.467,4.175,0.247,4.244,3.677,6.238,0.809,0.877,6.183,3.101,2.243,9.537,7.826,4.296,3.204,9.337,4.486,2.248,3.369,2.14,1.44,4.052,8.453,0.632,3.378,3.377,1.781,7.793,0.277,3.436,2.662,8.624,4.761,4.876,7.105,4.936,0.52,5.943,1.782,1.692,7.394,1.405,5.273,5.651,8.828,5.783,1.274,5.064,3.85,4.132,0.222,0.249,5.193,8.25,4.351,0.851,0.463,1.081,1.126,0.926,5.091,0.944,1.914,8.27,1.693,0.282,7.462,5.554,0.741,3.84,7.924,8.557,3.673,1.603,1.574,1.564,1.19,3.829,2.584,6.762,2.25,0.16,1.865,0.213,9.267,4.648,6.929,3.643,0.541,8.361,0.37,0.127,6.386,5.345,0.423,3.774,1.004,4.46,2.749,3.693,3.357,4.158,0.7,0.728,1.19,0.824,3.842,0.506,0.247,1.923,2.916,4.656,1.972,0.49,3.553,2.91,5.48,2.822,1.506,7.432,0.923,9.364,9.322,2.227,6.506,1.912,0.998,5.734,3.635,5.16,0.943,4.502,7.291,0.131,5.339,0.572,2.096,9.212,1.504,9.714,3.177,5.293,2.603,2.432,2.928,9.711,5.485,3.266,2.646,6.111,7.855,0.487,0.956,3.631,6.755,0.311,0.485,5.223,1.509,1.763,8.543,5.785,2.038,4.765,2.174,0.405,2.891,2.397,6.388,9.58,5.518,2.175,9.226,5.886,2.441,2.89,2.733,2.246,1.05,0.389,0.361,1.248,7.733,2.078,4.484,1.95,0.309,0.832,0.697,1.029,8.635,3.116,1.538,2.361,6.07,1.171,1.692,0.93,2.368,0.827,4.982,2.818,6.942,8.239,3.023,4.235,1.955,0.556,4.534,5.048,2.012,7.06,3.595,1.98,3.341,0.596,1.229,3.374,2.645,1.804,9.044,0.502,0.496,0.181,0.871,1.755,9.573,2.235,4.516,1.217,7.266,2.789,6.429,3.83,1.16,0.337,1.972,0.387,5.323,3.904,2.309,8.331,3.805,3.053,3.252,1.105,6.415,0.792,5.77,3.366,7.996,2.18,1.374,5.336,0.407,0.326,0.668,1.754,0.146,1.287,4.369,5.078,0.086,3.079,3.153,1.44,1.674,1.059,6.284,4.019,1.676,5.928,0.718,1.008,0.853,2.532,1.975,1.533,6.115,2.752,8.861,2.248,9.595,0.904,0.933,8.221,4.49,3.05,9.152,0.342,3.869,0.339,5.24,0.684,2.093,6.164,1.367,4.465,6.455,1.947,0.328,2.579,1.822,9.611,1.616,3.595,3.107,3.405,1.961,5.051,9.293,0.392,2.385,1.062,0.578,1.789,4.203,0.111,0.2,4.238,8.233,1.504,2.527,1.414,2.137,2.297,3.502,5.027,1.59,3.841,0.733,8.042,2.36,4.732,1.46,1.485,6.403,2.795,2.395,6.359,1.973,0.661,4.3,3.78,0.345,1.454,1.791,2.289,0.555,5.989,6.652,3.468,0.104,7.804,1.353,3.664,0.146,0.307,4.255,0.562,0.256,8.863,1.192,6.865,5.256,0.304,1.454,4.501,1.741,1.834,7.697,2.069,7.582,2.19,5.196,1.446,2.442,6.748,4.129,0.928,0.971,5.795,0.871,1.099,2.313,7.088,0.919,1.317,5.596,0.998,4.843,4.381,7.293,0.34,5.233,1.337,1.707,7.07,0.793,2.812,2.079,0.493,0.582,2.361,3.089,0.351,0.576,3.106,0.463,2.529,0.464,2.172,1.318,7.071,7.762,8.097,0.357,0.351,0.265,0.228,6.871,1.386,4.022,1.46,1.464,0.195,3.056,2.32,2.19,4.164,3.492,4.348,3.001,9.022,1.329,0.865,2.257,0.247,0.507,3.593,1.889,1.979,2.392,1.695,6.153,3.811,0.896,1.921,0.931,2.253,5.135,2.161,2.006,4.869,0.698,0.58,1.836,4.297,2.032,1.392,1.211,1.305,1.595,0.141,8.7,0.404,0.668,8.856,0.94,6.728,1.337,3.114,0.682,1.652,2.929,4.072,5.97,0.485,5.979,5.335,1.558,0.726,1.058,1.361,2.83,2.037,3.743,8.222,4.673,7.029,0.852,6.864,0.792,3.104,2.165,9.138,1.166,0.742,4.25,8.522,3.239,3.982,0.782,0.633,7.13,2.299,1.922,2.556,5.641,2.322,0.611,5.435,7.89,1.504,0.32,7.604,5.568,4.68,0.111,4.017,7.904,3.48,3.929,0.184,0.482,6.848,4.085,2.727,8.471,1.006,0.846,4.185,3.908,0.564,0.815,3.152,0.189,7.545,1.399,6.906,1.345,0.98,1.283,0.087,9.625,3.41,6.17,0.544,3.84,1.478,0.992,3.631,6.594,7.245,0.597,7.891,0.764,6.441,8.473,7.418,1.093,0.978,2.977,2.417,5.665,7.395,6.654,1.839,4.051,0.081,1.708,3.663,0.473,9.56,3.445,2.508,1.441,1.288,2.364,0.386,5.665,3.966,1.61,3.297,5.548,1.722,8.38,5.627,9.477,9.146,0.713,7.062,4.434,3.383,2.831,0.377,3.655,0.131,1.138,6.292,4.859,1.806,3.393,3.759,2.137,0.583,0.571,1.31,3.739,5,0.141,1.609,1.764,0.234,0.869,1.155,2.384,4.002,8.205,9.088,1.835,1,4.223,0.588,1.066,0.575,0.298,2.265,0.309,1.155,1.204,0.726,3.611,8.813,0.115,5.24,0.963,2.515,8.796,3.531,7.876,7.906,1.942,5.059,2.036,3.134,2.929,0.239,9.806,1.024,0.517,1.62,2.143,3.495,9.372,3.6,8.967,3.285,1.853,0.592,0.439,9.605,8.839,4.616,6.645,7.889,1.658,0.863,3.023,5.501,1.141,0.258,4.746,3.031,3.621,0.416,1.626,4.936,5.305,0.073,5.394,0.926,6.496,3.937,8.3,3.473,4.023,7.028,1.192,1.261,3.023,0.566,4.984,0.717,2.001,4.648,2.16,8.367,6.2,2.258,0.676,3.194,2.799,2.099,0.239,0.142,0.21,2.723,0.557,5.937,8.347,4.876,0.265,5.2,1.228,0.302,6.809,7.08,1.949,0.105,8.865,3.004,0.873,1.005,0.37,4.067,7.117,2.297,7.076,3.679,2.01,0.161,4.25,0.454,3.113,0.339,9.776,3.22,6.243,1.74,1.765,8.872,1.411,0.055,2.194,0.222,0.387,1.496,4.273,2.844,1.964,4.048,8.205,0.449,2.248,2.138,0.39,3.995,2.076,3.918,0.099,6.723,0.327,8.504,1.88,1.963,4.375,5.438,2.088,2.982,0.499,1.556,3.349,1.665,9.335,2.03,1.274,3.77,1.068,7.349,1.476,3.948,7.127,4.647,8.838,0.713,1.021,6.659,0.219,0.425,7.767,1.817,5.658,7.998,1.426,2.273,8.035,3.912,3.39,3.834,2.716,0.577,3.052,6.744,8.331,7.617,9.497,0.141,0.359,1.243,3.487,6.122,9.451,1.891,0.528,1.021,1.155,1.091,3.528,2.614,6.651,0.401,4.218,0.711,6.518,2.705,1.652,1.182,0.424,3.276,1.911,1.043,1.83,1.167,9.463,5.936,5.97,1.633,0.974,6.299,0.2,1.817,7.422,3.671,0.203,3.492,1.856,0.437,0.183,3.375,1.532,1.132,1.016,4.706,1.987,2.16,1.708,4.956,0.628,1.233,6.44,0.386,2.121,1.676,0.289,1.362,0.349,6.924,4.91,5.694,4.445,2.825,7.355,3.234,1.552,0.626,0.42,7.343,0.425,0.493,5.718,5.709,5.704,5.952,3.538,1.632,5.398,1.481,1.659,2.906,4.427,0.273,5.937,1.035,0.755,1.768,2.01,4.615,0.868,0.439,1.523,1.383,2.55,2.012,1.132,1.67,3.871,2.43,6.338,0.415,0.926,5.76,1.447,8.345,2.431,3.044,7.497,1.62,0.453,0.671,1.3,7.612,0.284,5.589,2.509,6.524,1.724,0.284,5.51,0.981,0.413,8.1,9.151,0.402,1.754,5.181,1.061,0.268,6.245,9.695,4.751,8.161,3.032,0.551,5.351,0.13,8.706,4.825,3.512,2.37,4.161,3.824,3.734,3.427,0.648,5.952,3.179,0.436,2.729,5.234,0.671,2.583,3.784,7.679,3.47,0.077,1.633,0.059,5.834,5.144,0.985,3.444,1.129,6.152,6.64,7.814,7.23,4.652,3.07,3.002,2.718,0.496,0.22,4.648,8.323,6.668,5.768,0.258,5.442,2.97,4.054,5.692,0.859,2.477,5.927,1.991,1.644,0.387,4.55,1.065,0.615,2.533,0.469,0.536,4.75,0.156,0.365,3.606,6.912,0.626,7.537,0.131,3.987,4.666,2.194,3.89,5.068,0.591,5.272,9.504,2.709,0.439,7.517,0.609,1.732,0.881,0.854,2.923,8.407,1.925,0.439,7.109,5.442,5.254,0.157,0.997,5.82,3.772,3.92,0.062,3.489,8.798,8.573,3.981,0.132,5.471,1.534,3.388,0.14,0.682,1.415,6.083,2.417,1.009,0.3,2.607,6.444,0.383,5.519,9.418,2.564,4.507,1.353,4.468,0.931,9.262,0.559,5.481,0.407,1.159,8.163,1.7,8.098,0.444,2.224,6.626,0.704,1.604,2.761,5.53,3.15,0.83,6.126,1.009,8.872,8.15,1.837,0.348,3.205,2.46,2.284,0.61,3.755,0.181,0.762,5.706,8.689,5.139,6.131,0.6,3.954,0.399,0.977,4.83,0.714,5.224,0.903,0.7,3.047,6.261,0.179,0.333,0.451,6.83,1.816,3.184,2.472,0.465,3.767,5.704,3.624,8.212,0.839,2.906,8.31,0.902,4.534,6.858,4.898,4.413,2.598,0.39,2.765,9.32,0.184,1.212,1.558,3.116,6.855,0.59,5.357,7.549,8.411,0.834,4.045,2.82,3.421,4.551,0.607,0.687,6.317,1.876,8.509,8.873,3.319,0.224,4.446,3.806,4.332,7.61,2.908,3.373,5.934,3.737,4.566,3.089,3.912,0.273,0.301,3.798,0.104,3.072,7.15,0.308,4.252,7.346,7.37,8.682,6.237,7.679,2.493,6.886,2.674,0.29,6.918,0.272,1.394,7.293,7.53,1.014,2.359,0.134,7.573,1.253,0.254,3.43,1.46,0.528,6.806,7.013,4.242,0.224,1.249,1.554,0.4,1.065,4.084,0.241,4.546,0.413,6.969,1.801,3.882,2.672,9.277,0.267,3.657,6.016,0.962,0.429,0.717,9.254,0.611,3,0.267,4.369,2.116,6.466,2.842,0.963,2.973,0.816,3.198,6.995,2.54,0.367,0.71,0.369,4.731,3.498,0.054,2.817,9.147,4.428,0.94,5.141,5.684,7.28,0.321,1.854,6.074,4.958,0.368,3.122,0.095,3.423,1.894,3.521,0.633,1.777,1.419,1.355,3.247,7.742,0.735,2.22,8.038,2.749,9.058,6.156,1.254,4.896,0.149,7.997,8.696,3.445,2.8,9.495,1.581,4.083,1.825,6.145,3.06,6.999,0.521,3.139,0.539,3.179,3.845,4.011,0.271,0.372,0.776,4.852,4.671,9.231,0.356,2.838,2.318,2.806,8.259,7.417,5.723,1.976,4.244,1.378,2.683,0.249,2.149,7.473,5.36,1.446,2.032,7.484,6.229,1.166,5.263,0.185,1.798,2.273,0.75,3.281,9.506,8.65,8.61,3.074,6.559,5.084,7.409,0.21,1.189,3.881,2.758,4.49,2.051,1.758,8.063,0.626,0.705,0.26,1.622,4.274,5.41,3.301,4.669,3.096,2.438,5.408,0.737,2.948,4.221,7.25,0.685,3.177,0.16,0.941,0.293,1.16,3.276,5.877,0.432,0.428,2.843,9.159,1.334,1.62,3.506,5.282,2.258,0.749,0.955,1.85,0.445,1.324,6.012,0.157,3.449,0.625,1.792,2.215,1.647,5.559,6.349,2.673,2.518,8.44,3.832,8.248,1.568,2.452,2.501,0.374,1.217,0.162,9.221,4.576,2.899,0.699,1.057,0.33,2.547,5.196,0.781,0.954,6.045,3.402,0.155,9.57,4.924,1.845,0.977,1.678,5.656,2.105,3.963,0.278,0.089,3.441,2.188,3.126,6.08,3.736,4.545,2.938,3.146,7.198,3.6,2.101,2.496,0.536,4.025,0.335,7.227,0.552,2.306,2.693,0.441,5.508,1.769,0.087,4.487,2.209,0.622,5.513,0.516,0.157,1.414,6.047,1.932,6.21,2.743,5.148,1.583,1.829,4.472,3.834,0.324,8.147,4.848,0.187,5.019,1.771,4.23,3.978,0.867,0.333,1.132,0.379,8.359,1.378,7.036,2.008,7.347,5.466,0.334,3.674,3.818,0.611,1.324,2.46,0.688,1.729,0.451,5.859,4.63,0.906,2.585,5.94,0.151,6.858,4.212,3.118,5.711,4.798,3.909,1.609,2.759,5.525,0.632,0.281,3.255,3.927,1.419,0.078,0.506,2.056,4.604,6.254,0.786,1.291,1.02,0.152,1.062,5.776,2.323,0.727,0.181,1.537,3.613,0.911,5.595,2.995,7.953,8.539,2.355,4.627,1.672,0.561,2.867,1.567,3.429,0.507,2.666,0.254,1.689,2.171,2.561,2.693,2.734,7.212,0.489,0.083,1.493,7.268,1.457,3.118,0.496,2.081,8.093,8.432,1.288,1.791,1.248,1.629,0.293,1.492,2.83,3.613,3.631,0.174,4.236,4.969,5.486,2.059,8.905,0.422,7.14,5.415,0.248,9.209,3.66,2.512,6.776,3.25,2.437,0.879,2.031,4.286,0.496,1.474,2.387,4.756,8.955,2.615,3.562,0.857,1.56,3.324,2.46,3.415,3.216,1.348,0.394,4.266,1.355,2.835,5.781,7.674,4.951,2.301,6.422,1.028,1.518,0.277,0.037,5.71,3.327,0.497,4.255,0.146,6.186,1.418,2.797,0.116,0.7,0.257,2.687,0.823,0.662,8.434,0.092,6.672,3.021,8.04,6.693,3.979,4.332,0.532,2.942,3.954,8.66,0.463,7.654,2.608,1.915,0.743,1.38,8.399,2.319,3.042,0.832,4.274,4.05,0.193,1.803,0.239,2.724,4.421,5.119,0.607,6.092,1.8,2.235,9.676,5.593,0.48,0.319,7.479,4.432,1.133,0.756,8.058,2.477,2.019,0.164,4.006,3.432,3.358,0.265,3.889,0.295,1.444,5.497,3.046,0.9,1.444,0.207,7.232,6.427,4.001,1.009,3.212,1.863,0.694,3.431,4.482,3.147,3.124,5.267,0.738,0.656,0.158,0.566,0.38,2.214,0.82,2.507,4.186,8.237,2.836,1.076,3.558,7.77,5.258,2.461,1.784,0.56,8.095,6.505,2.018,5.382,6.115,8.118,2.23,0.779,8.141,0.481,4.802,1.963,5.803,0.995,2.005,2.682,0.219,2.232,0.178,6.849,2.784,2.078,5.339,4.636,3.317,1.908,3.256,3.229,6.065,7.557,3.792,8.498,1.106,5.978,3.222,0.796,3.647,2.504,3.638,1.497,1.325,6.742,1.257,7.315,9.233,1.52,4.11,2.366,4.371,0.483,1.708,2.279,0.301,2.396,0.442,0.065,1.074,1.082,1.005,4.609,2.733,0.326,0.841,0.575,4.07,3.93,6.434,0.763,8.756,3.323,2.7,5.023,0.307,4.212,2.325,1.319,6.847,2.628,3.007,0.593,0.574,5.303,0.844,1.023,1.083,0.233,2.371,6.633,0.425,7.947,1.343,1.695,4.789,8.934,3.614,4.292,4.243,0.385,0.126,8.228,0.567,1.933,4.978,2.892,1.351,7.371,1.736,0.331,0.181,0.18,2.108,2.513,0.206,8.495,2.889,1.501,1.441,4.345,7.427,0.605,5.651,3.16,3.335,2.849,1.14,1.899,3.687,5.552,4.094,2.163,1.816,3.835,0.234,4.719,3.834,7.147,7.658,1.88,0.196,3.507,0.122,5.642,1.089,2.444,0.099,3.64,0.196,1.168,5.178,0.116,7.136,6.353,2.909,1.068,1.228,1.986,0.674,3.036,0.43,2.241,1.054,6.449,0.437,3.107,0.183,2.752,6.718,2.614,0.284,1.889,6.641,5.822,2.279,4.866,0.715,1.351,0.221,2.626,3.985,5.047,1.366,0.495,4.584,4.948,0.158,2.289,2.399,1.559,3.527,2.524,3.883,0.055,6.508,6.193,8.075,3.151,0.847,3.354,0.475,5.36,1.261,0.279,1.856,1.217,0.747,2.378,3.303,1.002,5.945,3.44,3.32,0.093,8.697,2.29,3.99,0.556,0.998,1.121,0.99,0.907,0.797,1.932,1.924,3.31,8.615,3.24,0.805,1.679,0.359,1.059,2.044,4.753,3.111,3.953,9.139,3.281,6.446,6.819,0.226,8.543,0.456,7.569,2.743,2.436,1.647,0.567,6.644,6.89,7.978,0.184,1.59,1.057,0.617,5.93,8.885,0.579,2.303,8.12,0.548,8.436,0.168,3.394,6.384,5.335,1.615,5.734,0.656,1.259,6.144,0.497,3.175,6.521,0.821,1.09,7.84,0.226,3.791,0.135,0.99,0.171,2.477,6.729,0.241,4.29,7.612,2.362,0.507,5.382,6.783,7.779,0.67,0.857,1.816,2.343,0.27,0.675,2.996,6.89,1.195,2.381,2.149,1.556,1.261,1.562,2.016,7.067,8.136,8.102,0.096,3.588,1.74,1.014,2.96,4.86,2.58,2.016,6.027,0.407,2.404,3.397,2.953,5.428,1.71,8.671,1.483,5.559,0.278,2.736,0.36,0.682,2.75,5.552,6.389,0.94,9.875,8.287,1.848,7.541,5.722,5.82,0.582,0.129,8.516,0.593,3.276,4.5,1.013,0.404,2.807,0.167,8.97,9.264,1.848,4.835,3.723,4.475,2.159,0.19,1.899,3.383,2.132,6.958,4.487,1.164,0.58,0.915,1.584,1.6,6.895,0.229,1.105,6.257,8.484,3.1,0.19,7.574,7.85,1.537,0.241,0.688,8.268,3.348,4.038,1.446,7.142,0.669,1.761,7.632,0.959,4.665,6.669,0.3,4.124,3.441,2.714,7.099,0.204,5.541,8.366,6.227,7.966,2.22,1.963,4.367,0.369,3.221,3.272,1.03,0.212,1.089,5.838,0.732,3.112,0.353,6.815,1.726,6.337,3.356,0.462,1.224,1.521,0.126,0.357,6.1,4.687,1.577,5.088,1.966,2.341,3.689,0.716,4.092,8.527,0.273,2.016,2.622,1.891,0.769,0.628,0.996,2.741,0.998,2.177,6.972,7.908,0.131,6.103,5.073,5.106,5.788,5.613,4.17,0.946,2.631,8.16,8.495,0.623,7.853,7.346,0.166,0.429,6.369,0.506,5.53,9.516,8.256,1.104,0.574,3.644,1.063,6.544,2.675,0.175,5.301,4.329,0.354,5.552,3.979,0.354,1.67,0.157,1.416,0.563,0.472,8.838,6.119,4.242,0.228,0.779,8.522,6.867,5.054,1.588,0.426,2.872,6.445,0.939,8.026,0.576,3.531,0.433,1.541,4.251,9.431,0.499,1.021,2.793,2.517,7.994,7.563,0.437,0.277,0.707,1.404,0.317,6.751,4.536,1.426,2.83,0.115,0.813,2.706,8.216,2.859,2.353,8.485,4.653,1.503,9.378,4.849,0.258,1.696,2.831,1.208,0.343,0.329,3.862,5.607,0.639,2.584,0.557,0.975,3.424,1.405,5.268,0.469,5.796,0.843,3.298,6.07,5.242,0.657,8.719,0.095,2.111,4.142,2.4,1.864,8.066,1.474,0.41,0.334,0.121,3.616,2.743,3.942,4.374,1.012,2.452,0.571,1.359,2.326,2.944,9.341,0.081,1.158,1.01,0.249,1.318,3.603,0.302,0.365,5.037,9.734,9.028,5.595,0.635,6.856,2.681,1.671,0.137,1.145,9.732,3.167,0.236,0.038,2.895,1.924,3.594,1.413,0.481,7.024,1.146,1.182,1.488,4.085,6.412,0.674,2.434,6.843,0.942,4.047,3.114,8.141,0.544,8.939,2.737,0.525,2.133,3.079,0.24,2.991,1.692,4.913,0.597,3.571,3.456,3.603,9.118,4.456,3.554,0.45,0.69,3.821,0.319,4.352,0.2,3.838,2.806,1.169,2.101,0.412,0.217,4.043,0.327,7.564,2.121,3.53,2.899,0.767,4.368,8.468,9.16,0.054,1.994,1.074,4.093,0.469,0.319,4.959,1.92,3.135,7.068,0.359,1.054,1.413,6.456,2.75,9.133,3.683,7.148,2.534,3.584,1.4,5.516,0.598,3.9,4.259,0.453,4.26,3.634,4.081,1.403,0.553,0.199,6.45,9.861,3.931,1.053,6.078,0.569,7.856,2.784,4.391,0.935,4.486,3.094,0.09,0.19,3.387,3.025,4.035,2.529,5.084,0.937,0.333,2.497,1.184,9.677,2.3,3.976,6.387,7.037,4.137,2.133,3.908,0.881,9.323,0.428,3.768,3.486,6.101,2.361,0.876,7.989,4.653,0.449,4.118,5.102,6.223,0.244,8.656,1.819,0.151,2.119,2.807,0.181,5.886,3.774,4.552,9.811,0.21,3.798,0.892,1.675,0.202,1.032,1.658,0.532,2.049,0.919,5.206,3.748,0.433,3.304,1.034,2.639,2.395,6.475,6.87,4.177,6.784,1.889,3.535,0.784,7.595,0.258,1.563,0.215,1.563,0.473,0.794,1.163,0.805,2.772,6.03,3.35,6.741,5.747,1.687,6.999,0.217,1.248,0.536,8.892,1.707,1,4.788,2.197,0.671,1.392,3.714,2.516,7.181,0.515,2.55,2.47,1.133,1.568,4.184,4.344,3.761,3.33,3.048,1.136,6.897,0.888,6.766,1.75,4.275,5.887,7.695,3.212,8.151,1.34,1.428,0.463,1.1,7.554,4.968,0.372,7.373,1.998,7.972,6.709,8.332,5.814,0.42,0.55,7.263,0.811,1.388,3.369,2.988,1.878,0.893,7.573,2.898,1.191,1.523,0.255,3.143,1.405,0.124,0.583,0.421,0.049,0.426,0.496,0.273,6.877,0.317,0.487,1.297,3.869,3.143,2.257,0.561,7.973,4.989,0.558,2.173,0.106,3.707,5.607,2.96,0.596,2.56,3.901,7.724,7.9,6.054,2.334,5.551,5.938,5.237,0.242,6.003,7.416,2.607,5.549,7.125,7.443,3.665,0.346,0.946,0.32,0.229,2.576,1.957,0.543,3.106,8.027,6.549,2.285,1.69,0.789,0.222,0.156,4.04,9.153,1.801,7.758,5.289,1.008,0.861,0.265,8.811,0.477,6.71,0.311,4.366,3.824,0.319,5.16,8.843,8.349,0.864,0.423,0.568,1.294,8.332,9.225,0.252,0.916,4.273,2.757,7.286,0.362,1.338,0.822,1.729,1.3,7.096,7.665,1.281,0.179,0.952,2.647,1.218,1.081,8.011,3.519,3.117,4.517,7.692,9.444,0.492,0.478,4.991,0.703,2.187,2.69,8.947,0.904,5.192,0.158,0.073,0.81,0.925,2.929,0.127,5.155,9.189,9.184,2.106,0.734,1.584,3.294,4.123,2.084,0.255,2.913,0.437,4.789,3.631,8.487,0.125,0.602,1.068,6.328,5.27,0.147,0.192,1.498,2.805,0.688,0.852,3.372,9.293,5.082,1.048,7.198,9.422,3.928,1.148,3.564,2.758,6.045,1.795,2.353,4.573,0.151,0.551,0.624,4.101,1.567,7.876,5.306,0.142,5.07,7.887,5.566,1.63,9.172,1.847,2.658,4.257,8.554,3.957,1.041,8.76,0.935,0.701,0.669,7.335,1.481,0.285,0.37,1.446,2.157,6.829,2.569,0.349,8.195,0.107,1.755,0.279,5.717,0.79,5.927,3.597,2.895,2.83,0.632,4.877,7.027,1.215,4.452,5.08,1.324,7.92,1.897,6.987,8.376,1.349,0.229,4.88,8.376,6.298,1.623,3.218,1.723,2.169,6.264,4.954,0.137,2.06,6.055,2.202,4.647,2.059,3.945,4.277,1.31,9.39,6.138,6.021,0.375,1.932,0.885,2.974,4.935,3.545,5.665,1.95,1.528,6.121,1.175,3.132,0.328,1.212,0.538,6.747,0.093,2.615,0.192,6.286,6.918,0.367,2.07,1.226,2.283,7.622,0.364,3.525,5.742,0.864,4.597,1.902,0.67,0.986,0.887,8.627,0.839,7.612,0.123,0.717,7.445,9.423,6.947,0.167,1.856,6.782,4.509,9.485,3.735,0.132,0.61,7.229,4.469,2.831,2.522,2.067,5.117,1.253,6.428,9.408,6.233,1.058,1.667,0.298,6.767,1.373,4.53,6.248,1.958,0.141,5.258,3.59,0.92,0.563,4.316,1.465,8.458,2.03,1.665,1.208,0.452,5.986,5.941,2.973,2.739,1.783,6.94,0.66,0.467,9.437,1.417,1.036,3.106,3.074,2.694,0.963,1.41,1.066,5.563,3.511,7.747,3.865,7.097,3.223,7.052,8.97,0.937,5.734,2.908,8.495,5.155,1.504,1.511,0.834,0.244,3.246,7.42,5.185,7.451,0.507,3.744,6.155,5.116,1.785,6.523,1.201,6.616,1.833,1.969,0.507,4.78,4.716,6.621,7.795,3.42,1.642,6.968,2.123,0.441,5.086,3.692,1.595,2.094,4.871,2.891,8.981,3.894,2.088,0.812,3.918,8.523,0.255,0.915,0.583,9.444,1.803,7.404,8.727,2.834,0.349,0.284,9.425,1.42,4.945,8.934,1.031,2.74,0.858,1.4,5.199,3.806,5.72,0.208,2.143,0.524,2.706,0.348,5.678,3.7,1.526,0.276,1.572,3.886,7.298,2.864,2.253,0.867,2.392,9.161,5.716,2.54,7.998,2.684,1.725,0.324,8.203,0.98,3.093,6.494,2.283,1.302,2.421,1.82,1.41,1.37,3.13,6.474,0.48,8.986,5.448,1.109,5.686,1.028,5.985,2.454,2.126,1.611,0.395,4.998,3.896,3.951,7.961,5.571,7.254,1.925,7.128,0.941,1.318,0.197,6.864,1.988,1.736,5.846,0.365,1.826,6.921,2.33,1.848,6.94,4.137,0.091,2.469,5.487,5.128,8.088,8.93,5.415,2.839,0.196,1.941,1.578,0.464,8.414,3.515,2.361,0.848,7.883,7.675,0.241,4.564,6.135,1.119,0.744,0.327,9.369,4.806,0.315,4.572,3.691,3.447,8.784,0.495,3.633,2.761,3.49,9.359,1.333,1.254,0.747,9.05,4.814,7.621,1.286,0.517,6.896,6.997,1.911,6.995,0.255,0.897,1.031,0.128,7.863,0.111,0.476,0.959,5.026,1.1,0.489,0.236,7.07,0.962,4.96,2.703,4.066,1.963,9.022,8.196,0.554,1.698,3.704,0.39,2.242,0.34,1.316,7.432,1.21,2.332,0.794,1.333,6.445,7.106,7.531,3.511,1.329,2.909,4.788,2.011,2.446,6.047,3.621,4.735,4.973,9.387,2.453,2.092,5.215,2.492,1.729,1.871,0.533,3.399,0.77,1.185,0.236,5.723,3.947,6.476,3.702,1.883,5.985,1.586,1.521,1.078,1.389,3.125,1.181,6.064,0.543,2.865,0.822,1.087,4.729,0.437,4.51,1.504,3.411,8.267,0.897,0.992,0.637,4.193,0.684,0.828,0.7,6.745,3.645,3.345,2.074,6.757,0.298,1.037,2.41,2.027,0.988,2.428,2.015,2.657,1.022,1.509,5.468,5.03,0.833,0.304,0.469,7.195,0.461,2.652,0.498,3.784,0.078,3.082,7.604,7.656,7.452,0.256,1.343,1.645,2.988,0.342,6.627,1.096,0.752,3.108,3.27,2.397,1.607,5.741,8.588,1.283,3.861,4.554,8.083,2.132,0.504,0.724,1.001,0.648,3.234,0.449,2.094,7.484,7.901,0.719,6.863,1.058,1.221,2.377,4.991,7.346,0.086,6.539,0.629,0.442,5.384,2.029,2.876,0.909,6.602,8.994,0.26,0.367,1.42,3.728,5.084,6.359,8.996,4.421,3.233,2.623,7.282,7.075,7.581,2.102,0.529,8.635,2.839,0.48,0.962,0.984,8.406,1.085,5.536,1.815,1.04,1.904,2.642,0.506,1.842,2.707,0.787,3.5,1.195,6.449,8.944,7.367,3.858,4.347,0.435,0.195,3.084,4.855,1.274,6.633,5.663,1.221,5.67,7.197,7.016,0.451,0.234,1.056,4.021,8.96,2.125,2.159,1.305,0.32,3.296,6.219,3.802,0.82,3.332,5.765,5.757,4.163,1.74,2.164,0.837,3.407,6.789,2.209,0.574,5.639,0.238,2.913,0.398,8.662,8.048,1.443,1.061,3.856,5.061,5.602,0.407,2.217,0.389,0.743,1.867,3.223,1.841,1.634,1.806,0.536,1.774,3.13,0.971,9.433,1.019,8.77,5.999,0.538,5.175,3.826,6.158,1.369,0.827,0.048,0.271,0.715,1.74,1.942,5.373,7.56,1.451,5,0.255,9.44,4.203,5.057,1.81,1.708,6.729,4.997,3.841,0.818,3.95,0.876,2.068,2.621,3.529,2.691,1.045,0.862,1.274,7.115,5.605,4.959,6.669,0.678,1.097,8.111,0.994,0.63,8.234,4.89,8.272,0.74,1.912,1.014,0.412,1.061,3.676,2.529,0.374,9.848,1.153,8.061,4.876,3.071,5.936,2.03,5.462,0.146,2.906,7.993,9.686,5.782,6.782,0.163,0.809,4.255,0.537,1.446,9.415,7.823,7.453,0.467,3.253,6.23,0.915,0.432,1.771,2.244,2.522,0.495,5.55,5.068,0.21,7.583,3.576,4.322,1.698,5.797,1.72,8.97,1.69,8.023,6.799,4.427,7.325,0.386,0.198,1.167,3.569,3.785,5.023,5.084,8.235,0.875,3.894,5.504,3.01,1.312,2.662,0.3,0.256,4.575,3.228,5.607,8.93,7.034,2.719,4.82,3.697,2.963,0.593,3.189,3.218,4.987,1.873,0.764,3.139,0.919,1.477,8.119,1.528,0.345,9.517,6.431,5.755,1.776,2.878,9.366,1.634,0.177,2.738,0.168,2.549,6.227,3.192,0.623,1.17,0.617,4.306,4.622,9.313,2.339,8.837,7.894,8.674,0.626,1.595,3.756,1.53,3.011,5.907,1.101,0.091,3.604,8.238,0.459,0.588,5.384,0.572,0.237,4.027,7.869,9.826,3.726,1.031,0.598,3.708,3.127,1.075,4.164,2.554,9.455,0.46,0.223,0.121,0.48,6.356,2.591,1.381,4.16,4.223,8.11,0.69,0.668,5.508,6.076,1.736,6.799,0.831,1.1,2.065,9.285,4.153,0.306,4.782,3,1.232,2.947,0.963,1.086,3.294,3.049,4.754,2.888,5.901,0.291,2.178,3.911,4.889,2.784,5.074,4.119,1.918,8.11,4.432,0.279,5.141,0.64,1.926,0.997,5.809,3.361,8.713,2.892,3.869,1.154,0.202,2.907,0.984,1.045,5.263,2.257,2.152,0.406,1.561,3.513,8.303,6.048,6.504,7.343,4.35,5.744,4.953,2.075,1.369,4.514,2.042,7.59,2.274,7.077,5.165,1.806,3.084,0.498,0.429,0.559,1.589,6.445,0.69,6.227,8.318,8.287,0.38,0.295,2.81,0.583,0.534,4.093,5.051,9.854,1.569,0.238,1.733,7.693,0.446,5.723,0.47,3.804,5.743,0.337,7.626,0.654,4.813,1.863,2.991,1.048,4.835,6.011,7.698,4.21,8.364,6.856,2.905,1.065,0.786,0.104,1.139,6.984,7.32,0.28,1.95,3.384,6.49,0.25,2.917,8.651,2.53,5.883,1.042,4.55,6.579,3.103,0.888,3.972,0.58,9.947,1.777,1.9,7.547,2.858,3.113,0.664,4.027,6.251,4.826,2.755,4.623,2.501,1.591,1.29,3.037,2.155,3.991,5.591,1.451,3.36,0.242,1.966,1.946,8.694,2.138,5.603,6.536,0.358,6.486,5.056,3.741,1.957,5.151,5.33,2.475,4.012,2.397,1.322,4.058,5.31,1.135,0.526,2.153,1.676,1.634,3.836,1.559,2.866,4.871,3.081,0.451,1.53,6.8,9.11,1.415,8.407,0.217,5.77,5.705,1.333,4.827,0.705,0.269,6.165,1.401,2.317,2.69,0.495,2.296,7.835,0.941,0.501,0.259,8.469,9.922,2.675,5.343,6.014,0.135,1.078,0.187,7.986,5.238,8.851,0.18,0.105,4.544,4.634,5.011,2.096,1.66,0.158,8.081,6.53,0.584,2.772,0.712,2.388,6.349,2.16,3.967,8.755,0.114,3.329,0.721,6.131,1.069,2.995,1.879,3.136,1.644,4.042,4.974,2.859,0.306,1.68,1.158,0.871,7.037,0.379,1.992,0.662,8.725,0.271,2.481,6.303,0.668,4.663,1.322,8.476,0.514,0.772,1.72,5.142,9.077,0.174,0.31,2.771,4.087,1.34,3.194,4.559,7.606,4.324,9.444,3.494,2.613,8.513,0.287,9.058,6.461,1.746,2.898,0.652,2.438,3.958,1.3,4.702,0.627,1.067,5.514,8.723,0.455,1.648,0.644,7.539,1.08,0.81,0.717,2.446,0.24,1.217,0.52,0.194,5,1.158,1.893,1.242,3.711,2.168,0.712,4.734,2.61,4.442,6.494,1.492,6.275,2.868,8.476,7.611,0.814,0.696,5.512,7.418,8.106,8.78,5.494,2.443,5.32,2.105,0.511,0.86,1.539,0.936,9.314,2.482,3.903,2.185,6.995,0.547,0.988,1.697,6.336,7.091,1.386,0.221,0.546,0.221,7.876,0.734,3.097,0.194,2.272,2.156,6.209,1.153,0.46,1.672,9.396,5.81,1.013,5.305,2.509,1.068,7.718,1.395,3.009,2.399,3.194,8.041,5.84,4.523,1.008,7.158,3.859,0.771,3.193,3.182,2.01,4.28,2.823,0.164,4.575,7.291,5.055,0.246,1.113,0.432,3.518,3.575,0.132,0.69,2.162,1.857,8.452,3.862,2.681,0.172,0.448,1.888,7.526,0.617,6.463,2.178,8.635,2.21,6.415,1.662,1.665,0.509,3.657,2.656,7.895,0.572,8.477,1.789,9.032,0.207,0.881,0.42,3.653,5.503,2.809,4.921,1.767,3.048,1.202,8.012,3.2,5.621,1.228,4.306,5.762,1.656,4.231,0.451,4.496,4.188,6.073,0.101,0.415,5.062,1.714,0.187,2.423,7.583,9.117,4.767,0.134,3.633,8.489,7.52,1.634,3.981,3.008,4.138,7.98,2.501,7.836,0.127,1.136,5.746,2.056,2.025,6.731,3.128,2.334,0.09,0.152,0.712,4.781,1.642,9.07,2.035,3.425,2.461,3.59,3.717,2.907,5.261,6.907,1.948,0.943,2.161,6.725,0.231,2.623,2.259,1.214,5.776,2.039,0.365,0.51,1.295,1.048,6.271,2.595,3.771,0.133,1.957,8.188,9.353,6.954,2.789,0.556,1.367,7.379,5.303,1.066,5.091,2.064,7.093,0.439,2.17,0.478,6.51,9.471,7.315,6.911,4.11,3.118,3.687,0.086,4.285,0.287,7.036,0.373,0.508,0.197,3.654,0.602,0.414,2.55,0.598,6.998,9.101,3.687,0.242,0.401,2.933,0.545,3.801,0.348,1.21,0.903,2.861,1.71,3.581,6.032,2.919,3.583,2.052,0.625,0.644,9.523,2.344,1.904,5.344,0.258,6.552,4.834,7.836,1.134,1.045,5.471,4.77,3.043,5.858,3.617,2.932,0.277,5.449,4.631,0.312,0.691,2.528,6.428,0.903,6.863,4.464,1.051,0.234,0.564,2.471,1.048,8.906,0.715,4.039,3.02,1.465,4.446,0.495,5.134,1.597,3.043,1.511,3.395,0.193,0.726,8.034,2.007,5.811,3.955,7.908,0.593,0.634,4.384,5.051,0.286,0.487,0.325,8.555,3.45,0.306,1.239,4.856,2.295,7.673,5.711,6.982,2.56,3.79,3.291,0.059,4.178,2.828,2.462,2.742,9.908,3.869,1.084,0.92,0.562,3.876,1.721,9.02,1.487,6.984,5.709,2.878,1.201,1.858,8.463,5.217,5.177,0.453,1.848,8.253,7.837,9.471,8.21,8.439,8.703,1.313,7.133,2.876,6.818,4.53,2.55,3.556,0.941,0.412,7.223,7.531,4.326,8.338,1.251,9.257,1.069,7.377,2.366,7.168,3.806,1.294,2.002,1.283,0.072,0.689,2.579,0.674,0.215,0.199,7.939,2.971,3.235,0.641,0.464,1.258,2.199,0.881,0.126,3.807,0.309,0.293,0.385,2.318,0.677,4.031,4.399,8.151,0.379,4.259,4.448,3.063,8.771,0.246,0.389,0.507,3.523,3.3,2.969,1.691,7.272,0.615,3.773,6.779,0.306,4.363,4.849,6.924,3.415,2.744,0.845,7.471,2.693,3.786,0.608,2.493,0.383,3.464,0.796,0.646,7.672,3.404,0.392,4.008,0.689,3.221,7.015,3.998,4.82,5.65,1.747,3.453,2.808,2.114,4.046,4.964,6.47,0.849,1.534,7.976,3.301,0.218,4.952,0.976,1.401,1.769,0.181,5.951,6.255,7.662,0.901,0.484,0.842,2.765,1.273,8.006,6.983,1.565,7.413,4.211,0.341,0.277,1.259,1.646,1.174,0.178,0.369,0.225,5.018,8.201,8.102,5.68,4.956,2.645,0.644,0.892,0.155,1.841,5.53,9.289,0.159,7.933,0.379,1.948,0.459,0.711,1.165,5.655,4.834,5.699,2.344,4.896,4.56,3.589,5.813,8.177,1.73,1.789,0.184,1.281,2.667,9.155,1.007,2.053,0.324,2.543,0.339,4.59,1.952,7.202,3.084,1.789,2.763,2.029,5.425,8.633,0.289,4.046,0.976,7.588,0.254,2.95,7.331,2.142,8.83,3.978,0.675,5.72,1.13,1.598,0.202,6.064,1.709,4.689,4.355,6.71,7.281,1.399,0.417,0.177,3.091,8.503,9.137,9.383,2.561,1.224,6.501,4.706,2.188,2.958,0.662,1.638,2.811,1.016,0.963,1.37,0.736,1.283,0.322,4.581,4.467,1.835,0.585,6.388,1.135,7.924,3.496,2.433,1.535,1.516,8.051,0.471,0.459,1.095,4.674,8.378,4.671,5.672,5.576,2.905,5.578,0.308,0.26,0.75,5.057,3.87,9.334,0.19,0.118,4.238,6.937,7.776,1.284,2.007,0.893,2.859,0.11,1.068,2.16,9.534,2.493,4.639,1.767,8.89,1.408,0.351,0.9,4.992,1.081,2.149,2.304,4.403,5.733,0.243,1.37,5.853,9.163,1.465,3.053,4.723,1.144,0.356,8.569,0.161,1.914,3.095,1.041,7.747,5.421,2.268,4.067,9.084,3.983,3.586,4.638,3.874,5.076,1.662,3.119,5.536,0.912,2.315,0.458,3.397,2.075,9.242,0.477,9.296,6.566,8.354,1.508,3.696,0.195,0.224,4.236,0.244,0.922,1.852,2.379,1.466,0.47,0.571,3.379,9.472,2.002,0.723,0.303,2.958,2.028,0.426,2.441,3.551,0.341,6.27,7.319,0.447,0.135,0.921,0.864,0.353,0.206,1.945,8.318,0.632,1.187,2.782,5.058,0.367,8.659,0.96,0.301,6.853,4.269,8.15,0.466,2.036,3.686,0.521,5.773,1.522,5.755,5.3,4.521,1.664,0.756,1.223,1.208,7.094,1.922,4.19,3.781,4.509,0.715,3.415,3.653,4.335,1.031,1.433,1.607,2.296,3.107,9.77,0.757,3.281,6.8,2.19,0.24,2.848,1.968,2.393,8.988,2.501,7.199,0.906,0.942,0.68,3.195,0.311,0.112,0.086,1.868,2.194,1.24,7.052,1.282,1.161,0.79,2.403,5.076,7.304,0.574,1.55,0.436,6.656,0.435,0.359,0.548,1.104,8.199,6.155,0.679,7.914,0.757,0.595,7.523,0.192,4.636,1.145,3.978,5.406,1.129,1.545,2.709,1.427,9.239,1.763,2.848,5.932,6.118,2.754,4.298,5.914,7.045,5.489,9.758,2.048,1.551,5.818,0.202,4.284,0.154,1.727,5.846,0.187,2.742,2.876,3.135,9.081,4.552,5.962,7.036,2.38,0.877,0.789,2.321,0.62,0.671,6.254,3.314,8.641,5.324,8.398,0.871,2.251,3.217,0.438,0.654,1.505,5.607,3.477,0.274,0.256,0.186,2.099,3.262,7.251,4.224,8.869,0.58,7.601,9.335,0.557,8.053,5.274,0.425,0.895,7.532,0.439,1.88,0.466,2.225,8.21,6.07,5.287,1.326,0.374,7.252,1.873,3.093,0.537,1.736,0.822,3.036,5.853,6.288,1.529,1.429,3.916,0.557,4.152,1.944,0.374,0.194,4.506,8.389,0.821,1.695,0.447,0.348,3.954,5.567,2.082,6.844,8.534,1.494,6.894,5.677,1.293,0.864,4.793,0.932,5.047,4.542,1.5,7.41,2.783,0.684,3.927,0.639,6.144,3.772,6.391,6.61,5.109,0.781,0.829,4.075,0.248,0.291,4.997,0.92,0.773,1.134,1.305,8.835,6.269,0.7,2.057,1.321,2.395,1.395,4.885,5.448,8.754,5.282,9.043,1.032,1.109,1.714,8.485,7.63,3.246,1.086,5.422,1.305,4.81,6.287,1.243,2.286,6.677,2.732,5.36,1.298,3.065,9.207,2.584,2.225,1.604,5.609,1.205,0.334,8.285,0.402,0.619,0.826,1.989,0.203,7.086,2.173,4.794,3.151,3.638,8.339,2.901,7.009,0.297,8.146,4.517,9.744,0.222,6.262,1.445,7.881,7.309,2.03,2.31,1.888,9.493,6.869,5.24,1.408,1.078,0.285,7.282,0.932,2.301,0.092,5.367,5.775,8.674,0.54,2.278,2.373,2.744,1.66,2.005,1.685,3.119,2.115,2.637,2.524,0.63,3.692,3.84,3.061,4.58,1.269,3.095,6.547,4.394,3.852,0.171,1.555,3.444,2.665,5.464,4.615,1.495,4.908,8.391,9.072,2.048,6.67,9.082,4.663,1.343,7.245,2.883,2.26,7.191,7.599,0.277,2.549,5.873,6.983,7.814,0.374,5.091,0.723,1.637,5.699,2.627,2.038,4.761,7.494,0.791,5.707,2.371,5.587,4.09,3.078,9.611,4.789,0.3,0.907,5.229,4.1,1.265,0.624,1.281,0.444,0.501,4.35,5.192,4.096,1.175,2.595,0.212,8.469,3.337,3.026,5.691,0.56,3.681,4.981,3.759,0.633,4.729,4.837,7.532,0.288,1.949,4.584,5.4,2.544,3.805,7.918,5.394,5.963,5.051,4.158,8.623,3.521,0.532,0.797,1.784,6.953,8.676,0.537,1.36,0.831,8.656,4.071,9.528,2.827,0.554,2.24,2.893,0.79,2.709,3.886,2.465,2.267,2.242,4.433,0.251,0.467,0.55,2.243,3.188,0.268,2.095,3.608,8.453,3.092,0.431,5.72,9.638,5.647,4.346,1.373,1.312,0.16,1.407,0.593,2.402,0.28,1.617,8.199,0.126,3.823,5.883,6.747,3.63,1.715,6.238,0.849,4.026,0.45,6.444,3.069,3.855,5.905,2.367,0.752,1.478,3.173,4.293,2.242,0.247,5.702,6.899,0.304,4.091,6.809,0.789,7.075,1.192,3.351,1.585,0.115,5.194,2.271,1.562,1.011,2.395,5.44,7.433,4.846,1.547,2.854,5.122,0.438,0.448,8.414,1.669,0.296,6.353,2.771,1.151,0.619,0.465,0.459,6.56,0.351,0.682,8.885,0.352,7.368,4.415,9.865,0.75,7.914,0.078,7.362,0.09,4.382,0.067,6.045,4.468,4.193,2.986,1.1,2.234,1.861,4.424,5.606,3.315,6.072,8.253,3.122,3.24,4.811,1.613,8.544,4.792,8.794,1.979,2.691,6.108,0.673,0.144,6.808,0.957,6.672,2.345,7.026,0.583,3.447,3.003,0.18,2.456,1.214,1.711,0.492,2.791,3.463,5.439,4.891,0.17,2.836,8.055,0.163,2.05,1.542,0.655,2.672,2.366,2.766,2.681,5.501,3.055,0.125,0.381,9.385,7.941,2.354,4.361,5.444,0.057,0.159,3.399,1.691,1.455,2.911,0.795,8.268,0.973,9.232,9.129,3.661,7.059,1.804,7.392,8.824,2.709,7.982,2.578,6.08,6.173,2.398,0.625,4.953,2.607,5.051,0.447,5.437,6.004,8.27,1.693,6.276,0.207,0.812,3.639,5.964,4.76,9.093,0.295,2.759,8.627,1.032,1.762,0.734,4.132,3.487,2.83,3.924,2.396,3.333,0.911,0.138,0.386,3.736,1.013,8.718,1.507,6.655,1.535,0.408,1.632,0.18,6.675,0.692,1.943,0.355,0.242,1.459,5.667,2.098,3.635,2.318,2.922,2.015,1.506,2.06,0.386,0.397,5.1,2.299,0.19,5.711,0.447,3.065,8.778,9.736,0.695,1.883,8.929,1.342,0.474,0.708,4.823,3.343,2.032,1.492,8.13,1.526,6.583,7.521,5.922,2.484,3.323,0.69,0.903,5.224,4.164,6.2,6.528,0.502,2.512,0.184,8.814,2.602,0.098,6.503,0.162,0.245,2.371,0.556,8.043,5.526,1.92,1.137,6.597,1.643,7.996,2.259,0.719,1.769,1.65,1.387,5.837,6.348,2.408,3.135,6.367,3.467,6.359,6.133,1.934,4.139,6.534,6.307,3.74,5.483,6.005,0.854,1.595,5.02,1.918,4.43,1.41,8.251,5.194,9.207,3.125,4.928,2.132,4.919,6.623,2.187,8.177,3.139,9.561,2.451,1.209,2.908,1.096,2.952,7.819,0.302,4.641,0.272,1.253,6.792,1.69,5.318,0.118,2.727,7.744,8.752,2.774,3.561,3.281,3.412,3.385,4.274,1.709,0.854,6.426,0.378,0.93,0.743,1.99,6.954,1.306,3.603,3.407,9.348,2.578,0.823,0.204,1.408,2.123,8.929,5.607,3.352,8.304,1.597,0.286,6.416,1.51,3.242,2.805,1.181,0.572,3.062,4.126,0.28,1.58,1.423,7.113,6.226,0.255,7.095,0.288,4.533,4.265,4.201,2.32,0.928,7.81,0.971,3.253,7.309,8.746,0.508,0.794,1.096,4.714,4.878,2.661,0.901,0.389,4.041,2.314,1.475,1.855,0.414,5.723,4.033,5.662,3.098,6.959,1.045,9.9,8.434,7.364,5.254,9.61,2.581,0.579,0.965,0.595,0.337,1.68,3.989,0.137,1.848,2.95,4.617,7.405,1.214,0.328,2.081,9.65,1.836,6.264,3.108,6.447,1.287,3.328,0.53,5.509,1.93,1.79,2.923,1.248,0.764,2.119,7.221,6.261,0.242,6.819,5.819,0.9,1.086,1.422,4.076,8.747,4.742,4.443,5.799,3.002,7.536,3.664,9.018,8.727,5.002,1.681,8.523,5.93,5.005,5.596,1.266,0.912,0.211,0.312,0.62,8.695,0.501,6.331,2.932,2.984,5.868,5.529,5.452,7.644,0.457,0.352,0.236,8.071,9.127,1.314,1.636,3.606,9.169,4.517,5.699,3.926,8.841,0.788,5.281,1.678,0.691,5.613,7.578,9.118,0.137,6.517,3.323,0.738,2.936,1.795,2.956,3.331,1.025,0.297,1.094,0.878,3.925,6.843,3.135,1.153,6.59,6.256,7.41,0.448,4.408,1.195,1.489,0.256,0.502,2.107,1.791,0.18,0.042,6.2,1.447,7.786,3.259,3.338,0.417,2.556,5.289,1.095,1.362,0.386,5.154,1.624,7.227,1.528,1.144,2.262,4.733,1.105,0.7,0.37,4.209,8.033,0.305,6.378,0.941,1.996,8.621,5.804,0.272,7.148,0.073,4.419,2.823,3.9,7.198,8.057,1.477,1.543,0.423,2.154,0.875,0.567,8.388,5.965,3.769,8.786,6.981,0.426,1.919,2.115,1.667,2.564,0.418,1.341,6.891,3.047,6.631,5.548,3.728,1.387,8.032,0.479,2.723,0.963,1.628,2.517,5.674,9.44,0.474,5.705,7.214,5.348,5.033,6.772,3.904,1.12,6.735,6.018,4.262,4.233,2.255,0.903,9.277,5.018,1.368,3.947,5.334,0.412,7.734,6.888,2.752,0.244,6.225,4.292,0.283,7.37,7.119,3.898,1.599,9.513,0.452,2.116,7.053,0.474,3.561,6.284,3.725,1.762,0.526,1.473,8.764,4.722,7.846,7.495,8.383,0.438,6.89,1.555,7.209,1.017,0.479,3.435,5.878,0.419,1.049,0.109,6.714,0.524,0.784,5.309,0.403,4.585,6.224,0.299,3.956,1.504,5.346,3.911,0.174,3.349,0.85,2.982,0.729,0.116,8.713,0.383,4.399,6.162,0.919,7.107,9.056,0.546,2.148,2.187,2.185,4.584,9.132,1.817,1.977,1.257,2.617,0.368,3.434,8.076,4.582,1.075,3.681,0.69,1.659,3.936,0.85,5.231,8.071,0.295,6.629,8.98,0.711,2.253,8.681,5.007,6.747,2.852,2.882,4.672,6.266,0.433,1.139,1.891,7.797,3.154,1.064,7.786,3.675,0.096,0.47,1.105,3.216,0.294,6.272,0.532,4.855,6.024,8.076,0.912,3.176,0.252,0.868,0.606,3.326,0.349,2.079,4.78,1.235,0.347,0.609,1.888,0.651,8.602,1.435,6.7,1.856,2.125,5.338,2.215,1.197,3.739,0.733,8.48,0.123,3.218,0.262,5.689,6.97,5.381,7.353,4.625,1.339,2.915,7.443,0.344,0.39,1.066,0.854,2.253,2.676,1.182,2.327,0.247,2.027,2.098,2,2.714,3.429,1.478,0.499,0.32,1.679,0.274,5.583,0.102,0.362,0.66,5.999,1.947,0.477,1.305,0.753,3.183,5.107,0.438,1.581,3.139,0.512,0.157,3.716,3.988,6.872,1.264,2.784,0.654,0.594,1.849,1.723,7.476,3.813,6.274,0.145,2.608,0.193,0.518,5.731,5.943,0.103,5.575,0.684,1.938,7.649,0.946,1.853,0.247,2.66,0.2,3.464,0.099,3.205,0.985,6.216,2.571,1.448,1.005,0.498,2.542,2.114,0.355,4.025,0.61,7.82,7.268,5.556,1.969,0.704,8.645,0.725,5.814,2.246,2.61,6.116,1.954,2.152,4.562,3.063,6.082,6.914,0.532,0.517,1.09,5.704,8.314,1.128,1.139,1.759,0.979,0.789,3.485,3.523,2.48,5.232,0.15,3.717,0.659,3.613,0.579,4.263,2.708,1.425,4.175,2.088,0.993,1.28,3.495,1.623,0.404,0.401,3.776,1.499,0.413,4.035,3.148,3.651,0.594,5.324,2.82,2.16,0.165,0.768,9.841,1.643,9.61,8.75,9.909,9.041,1.793,5.57,0.749,2.797,0.22,2.633,7.713,3.183,1.386,0.219,7.992,6.421,0.928,4.807,8.507,6.42,1.014,5.302,1.467,1.437,0.773,0.489,8.994,0.704,7.185,1.112,1.533,0.413,0.984,3.095,1.699,1.377,0.104,0.309,0.278,0.886,5.556,1.619,2.075,2.663,0.217,4.222,1.453,4.111,0.256,1.779,0.253,6.597,0.329,3.077,8.871,0.4,0.326,0.129,2.785,2.614,2.158,4.533,1.888,8.472,1.077,9.158,0.776,2.314,7.879,1.24,0.765,3.561,3.65,0.213,3.774,3.277,0.407,8.789,5.997,2.296,3.477,3.001,6.589,0.407,9.069,2.966,0.304,1.64,1.29,3.724,0.094,3.13,0.156,0.113,1.091,1.311,1.248,7.695,4.636,1.436,0.235,0.534,4.961,0.229,2.654,0.297,2.02,5.66,5.208,0.478,2.672,1.47,6.829,2.092,3.288,1.273,7.845,3.284,1.682,4.318,1.507,8.713,8.854,0.367,8.763,0.866,5.748,1.916,1.886,3.498,8.496,5.581,8.782,0.708,2.044,7.638,0.706,2.613,1.894,0.575,5.164,5.453,3.058,1.946,1.383,0.122,0.351,6.841,0.227,1.346,1.159,0.688,0.378,7.536,1.811,1.886,3.768,2.93,7.671,4.135,9.194,3.508,1.674,3.593,0.592,7.973,0.848,7.908,8.158,0.574,0.732,4.178,0.837,0.376,0.97,1.434,7.139,7.888,0.188,7.003,5.908,0.251,2.637,2.509,1.021,6.991,5.468,4.18,0.264,8.467,2.647,0.378,1.031,7.131,8.69,1.574,3.97,0.974,1.843,4.7,0.747,5.67,1.008,4.147,2.581,4.062,0.251,5.448,8.304,6.225,3.044,2.981,0.324,0.191,3.663,1.912,5.54,1.86,8.171,5.602,2.173,1.902,0.88,7.046,2.003,9.278,0.822,8.728,3.488,2.336,1.007,2.021,1.362,4.531,7.145,3.102,3.312,2.605,0.735,1.853,0.318,6.129,1.068,7.322,0.261,3.027,5.823,2.012,0.846,1.82,1.201,0.356,0.1,5.383,2.834,0.345,2.991,2.749,0.233,0.448,8.007,1.317,2.06,8.541,0.693,6.727,1.155,8.551,0.582,2.675,0.539,2.81,4.088,0.218,2.906,0.665,0.794,3.13,1.432,4.214,0.69,1.224,0.996,2.455,6.882,1.148,0.092,1.242,8.698,1.111,1.198,1.313,0.718,6.85,3.771,7.606,7.535,2.116,0.934,5.222,0.266,5.64,2.723,2.288,0.393,1.102,5.817,3.23,4.081,1.023,3.516,8.136,2.06,0.561,0.189,6.022,5.201,5.796,0.125,2.757,3.253,0.173,2.75,2.309,1.391,1.924,9.285,1.893,2.216,0.833,4.132,0.509,3.938,1.985,6.655,1.591,2.062,3.091,8.288,4.464,8.963,7.016,3.126,3.901,7.671,0.094,0.898,4.112,1.969,2.792,6.003,5.257,0.565,1.067,2.475,2.46,8.181,4.175,0.441,4.982,6.118,4.625,2.777,2.79,3.14,2.124,3.2,4.531,3.805,1.526,1.49,2.116,1.318,4.82,9.089,6.577,2.59,2.125,1.373,5.334,0.37,6.588,3.34,4.704,0.23,0.833,4.498,0.945,0.255,0.126,4.236,0.128,1.541,4.381,6.036,2.051,3.575,0.907,0.621,4.64,6.082,4.002,1.135,0.531,0.242,4.656,6.152,8.26,2.398,0.094,6.903,5.848,4.891,2.214,3.245,6.504,6.96,1.598,6.26,5.581,0.693,1.474,2.201,0.262,0.222,0.437,1.863,0.836,0.595,1.07,5.725,8.12,1.449,0.43,1.945,1.848,2.471,1.58,0.77,6.679,0.119,8.066,1.441,2.589,1.243,2.649,3.639,5.302,1.154,1.885,7.199,3.202,4.224,8.242,2.129,0.605,1.503,3.235,1.435,8.062,3.284,4.458,1.59,5.837,7.791,6.37,3.104,2.653,8.535,0.196,2.55,2.073,1.513,0.654,4.164,5.995,0.484,9.087,3.979,2.594,5.395,1.465,1.655,1.302,0.663,0.407,0.951,0.306,4.509,5.063,4.239,0.474,0.579,9.295,7.78,6.091,5.206,0.815,1.117,0.267,0.363,1.482,1.331,4.165,0.055,4.466,3.13,3.975,3.459,1.65,1.901,4.535,3.699,2.988,2.757,1.348,1.198,2.196,2.061,0.984,8.799,9.189,1.587,1.767,0.383,8.038,8.82,2.156,1.481,0.126,5.814,4.427,3.285,2.366,1.256,2.784,1.79,4.812,0.964,0.492,2.664,2.623,0.865,3.556,2.4,2.099,4.086,6.321,2.203,0.713,2.113,1.227,1.878,4.135,1.598,1.01,0.173,0.85,0.162,1.097,1.186,0.918,0.256,8.194,0.212,2.101,5.584,4.059,6.127,2.406,2.265,6.598,0.398,3.376,2.48,3.376,4.995,6.308,6.956,0.287,7.237,5.862,0.571,1.675,2.919,4.434,4.382,8.702,2.055,6.197,4.769,7.5,7.079,5.2,2.101,4.44,5.736,7.273,1.535,4.381,3.93,1.042,4.288,2.669,6.397,0.688,0.612,2.313,7.399,4.207,0.801,1.496,3.101,3.077,0.243,0.226,5.982,2.162,5.364,1.519,0.468,6.29,1.739,5.86,1.694,0.804,0.237,3.191,2.329,1.26,0.302,1.53,0.617,6.445,1.973,0.724,1.042,5.644,5.814,1.867,2.198,3.666,1.226,8.087,4.141,0.961,4.665,4.594,0.616,4.115,5.832,5.937,1.893,8.175,4.111,1.023,1.851,0.333,4.835,4.735,4.39,0.454,1.95,2.78,0.254,5.786,7.716,5.855,6.632,2.192,2.87,9.101,1.23,8.261,0.882,1.308,6.491,4.531,1.834,0.703,0.981,1.272,3.837,0.997,2.525,0.682,7.218,0.19,2.943,2.84,1.029,0.245,1.253,3.587,0.449,2.96,0.83,1.327,7.393,3.937,0.277,2.651,2.393,0.326,0.355,1.274,4.184,0.386,4.223,6.964,8.838,5.336,2.078,2.028,1.352,2.172,0.836,2.097,4.09,6.534,2.837,0.137,7.081,1.58,9.279,0.593,5.31,4.927,0.547,0.48,0.562,1.325,0.911,6.161,5.653,0.178,6.446,5.368,5.146,0.795,1.906,3.312,0.268,3.68,6.427,6.006,3.135,0.253,5.071,1.076,6.032,3.045,3.861,2.824,1.708,6.047,0.334,2.034,1.779,0.194,2.188,3.946,5.101,0.624,5.516,0.296,0.165,0.065,0.472,3.772,0.736,1.023,4.959,1.202,6.685,4.623,5.277,7.849,8.642,2.708,9.002,1.337,0.44,0.277,3.767,0.97,1.694,2.22,8.919,3.28,0.06,0.522,0.101,4.45,5.914,5.929,6.113,2.08,3.468,0.991,1.643,0.815,0.827,1.723,1.012,0.73,6.112,6.845,0.443,8.133,0.613,2.171,0.391,2.614,4.447,2.881,0.522,4.573,2.319,0.617,6.652,4.33,4.084,2.751,4.975,2.894,4.828,4.186,0.935,0.406,4.977,0.823,0.139,0.404,6.7,9.09,2.503,9.126,1.598,7.1,2.249,3.568,2.349,0.204,0.388,1.927,0.301,1.108,9.457,0.855,2.175,1.262,2.575,0.116,3.139,1.91,8.165,0.573,3.195,4.639,1.939,8.351,4.943,0.35,1.933,4.13,8.991,2.389,8.559,0.778,0.729,3.569,5.102,1.25,3.823,0.724,9.526,2.415,4.323,7.553,1.163,4.878,0.736,4.274,7.724,0.56,1.041,7.153,8.346,1.059,0.379,2.983,5.239,4.95,0.554,7.642,0.237,8.87,2.088,8.111,0.7,1.171,8.319,3.8,0.651,0.522,5.682,0.805,7.217,7.825,8.148,1.166,3.551,2.202,9.229,3.311,1.585,0.278,5.401,0.844,1.685,5.643,2.815,5.521,8.451,3.07,0.362,6.711,5.821,2.339,2.881,1.746,4.733,1.354,6.88,0.265,7.919,5.056,4.1,0.139,3.358,5.866,0.145,1.601,1.699,4.119,0.437,4.764,1.593,1.147,9.765,1.78,5.204,0.307,6.388,0.238,3.668,9.054,2.993,1.588,5.557,0.729,1.126,8.618,8.177,3.407,8.079,3.733,0.154,6.936,1.373,2.516,1.58,1.628,2.143,3.617,1.182,0.811,6.48,5.53,8.874,1.06,6.766,4.803,1.978,3.339,5.838,6.342,0.701,0.123,0.378,1.748,0.908,2.019,0.51,3.831,0.149,0.238,0.739,2.37,2.705,5.556,0.125,4.946,5.424,0.381,1.246,0.367,3.144,1.578,5.848,8.414,8.152,1.101,6.839,3.715,0.323,2.918,3.098,4.607,3.376,1.816,0.064,3.497,5.755,1.443,3.026,1.196,1.217,1.307,4.896,0.518,2.348,0.4,1.286,1.144,2.988,3.912,4.29,7.861,0.523,2.185,2.719,4.307,7.045,5.131,0.679,0.07,3.564,1.833,0.977,4.364,5.079,8.393,4.744,2.897,6.34,7.465,7.533,5.219,8.847,2.509,9.042,1.038,2.024,0.865,3.907,0.934,1.218,8.748,4.723,2.026,3.07,0.87,6.729,0.711,8.335,3.989,7.915,0.457,5.123,1.73,0.45,5.113,0.221,9.203,0.268,3.669,5.876,4.446,1.297,6.495,0.889,6.41,5.002,2.318,8.823,1.688,2.279,2.303,9.622,6.591,6.139,7.543,2.76,0.865,5.508,1.232,1.089,1.179,1.885,0.15,3.578,4.869,7.058,1.418,4.182,1.695,1.489,1.832,6.901,6.336,2.572,1.106,0.176,1.57,2.404,3.339,5.381,1.831,1.26,6.308,2.081,3.596,3.869,4.596,3.12,5.308,0.746,4.207,5.831,6.805,0.945,1.117,3.094,4.344,1.516,1.315,7.79,1.799,3.609,7.065,8.158,0.366,8.899,0.868,1.584,2.046,2.762,0.505,4.523,1.19,5.282,1.124,0.948,8.774,1.868,2.739,0.691,0.324,7.932,0.58,2.607,0.112,2.34,2.482,8.988,1.108,7.994,5.527,6.349,5.141,1.568,1.46,1.265,7.162,7.057,9.553,2.131,0.913,2.674,0.208,1.08,3.659,2.905,2.053,3.374,9.086,1.43,0.524,3.436,0.14,4.819,1.421,6.643,1.861,1.457,2.154,3.64,1.932,1.558,6.415,0.061,5.184,8.023,3.776,2.469,1.396,4.961,0.526,7.225,9.026,1.155,0.621,2.405,1.495,8.664,0.297,6.293,1.933,5.144,8.786,0.362,3.018,6.827,5.618,5.441,1.894,2.247,0.267,1.621,0.253,0.977,9.074,1.197,2.643,2.083,8.297,5.179,3.74,4.243,0.532,2.299,8.913,5,0.438,1.102,3.215,4.493,1.671,3.319,3.183,1.955,5.937,0.699,9.248,2.743,3.013,5.507,1.099,1.279,1.274,0.501,7.742,1.181,5.476,9.08,0.15,8.635,7.243,9.632,0.144,1.896,0.816,0.756,0.928,3.448,7.316,3.267,5.924,3.537,0.529,0.128,9.437,8.306,1.979,0.68,2.239,1.126,2.557,6.889,0.78,1.541,1.583,7.208,2.321,0.269,1.277,3.796,2.694,0.337,0.837,7.487,5.448,0.123,4.265,0.51,7.572,2.891,7.462,0.997,0.253,6.27,6.718,0.375,3.531,0.165,0.899,2.374,6.585,0.27,5.395,3.249,4.493,3.372,2.851,0.069,0.203,8.068,0.881,0.157,1.353,0.788,0.329,5.276,2.226,1.842,8.27,4.755,2.591,0.924,2.324,1.878,6.23,0.123,0.196,3.975,0.56,2.245,1.284,2.627,1.239,4.049,0.217,1.209,0.375,3.506,2.089,1.059,6.756,3.474,1.904,0.403,4.054,4.412,4.453,0.51,3.642,6.987,2.936,5.798,6.065,9.833,0.699,0.246,5.845,1.721,1.158,1.091,4.04,8.241,2.004,2.437,2.335,1.296,1.574,8.129,2.305,1.583,4.038,0.589,2.814,2.847,0.77,3.391,0.371,0.723,0.323,2.647,3.02,9.389,3.945,1.224,1.25,0.493,0.527,8.256,6.808,0.922,1.493,0.218,0.286,1.212,1.976,0.134,9.089,0.563,1.29,2.075,4.835,0.165,1.64,0.629,2.643,1.183,1.969,2.868,7.838,1.467,3.741,1.491,0.233,5.066,2.408,0.698,0.15,3.648,2.496,3.347,5.904,0.48,0.055,0.387,3.597,0.917,3.228,3.895,1.904,0.34,2.354,2.959,0.185,7.351,1.332,3.516,2.209,2.509,2.349,5.774,3.971,8.771,2.59,4.993,2.691,4.08,1.175,2.119,7.641,4.91,0.92,6.488,4.362,4.509,8.772,0.403,6.372,6.26,7.995,4.65,0.51,7.717,0.431,0.877,1.114,0.509,1.282,1.789,7.81,0.85,8.782,0.201,1.631,6.412,4.496,5.779,5.638,4.181,2.057,3.716,4.6,0.11,0.304,7.231,8.913,6.667,4.995,7.411,5.746,0.728,1.453,9.665,1.299,6.342,2.787,6.699,3.387,5.998,1.459,0.847,5.522,1.628,0.087,2.295,3.426,2.304,0.251,6.494,3.416,1.715,5.332,1.79,1.314,1.282,8.996,9.263,0.576,0.945,0.689,1.114,0.902,4.366,0.802,2.358,2.597,0.28,4.618,0.894,0.203,7.617,6.747,0.675,5.324,6.391,1.493,5.862,0.45,0.91,9.05,5.682,0.717,6.273,0.838,4.033,1.92,2.67,1.05,6.311,0.871,6.289,0.741,0.072,6.982,3.868,2.299,5.901,3.567,8.747,1.149,8.26,1.25,1.298,0.946,1.639,0.56,0.392,5.586,7.407,2.791,4.104,2.584,1.469,4.984,5.22,3.951,3.422,5.106,7.981,2.038,0.22,2.967,0.562,8.043,1.363,6.542,3.029,1.828,0.3,5.246,2.259,2.367,7.036,4.383,0.375,3.611,8.396,1.298,1.37,2.611,0.411,0.549,2.492,4.635,0.856,3.772,0.519,4.37,1.132,0.443,5.817,1.103,2.515,4.756,4.918,5.872,0.779,1.001,0.909,2.084,2.568,2.333,0.98,0.144,0.539,1.038,7.432,8.187,4.696,9.436,2.966,0.812,4.986,0.216,3.404,7.244,4.331,0.157,1.178,8.799,0.713,1.396,3.133,0.766,8.125,1.813,0.165,0.256,8.562,0.09,2.013,6.108,0.825,0.825,2.751,8.171,4.269,1.015,3.561,1.209,7.887,3.627,2.835,0.123,1.099,7.107,0.415,1.479,0.328,2.89,2.394,4.368,1.695,3.157,0.799,2.024,0.441,1.775,0.147,2.035,1.252,0.427,3.289,1.322,3.614,0.428,0.092,7.641,5.011,0.445,7.236,9.21,5.517,0.37,3.339,1.578,1.186,4.794,3.325,0.415,1.228,0.243,2.834,1.6,1.57,2.334,2.204,8.633,6.373,3.121,2.649,9.318,3.996,3.996,4.701,9.243,5.759,3.512,0.881,2.272,2.353,0.259,5.88,8.812,5.757,1.081,8.692,0.48,0.557,2.624,7.338,1.114,8.799,6.44,0.998,8.42,0.172,2.201,5.672,1.408,0.452,8.656,3.823,6.725,1.394,6.824,4.564,7.871,7.59,0.591,4.284,3.738,5.81,2.581,6.049,2.374,5.471,5.553,9.681,5.587,2.496,1.027,0.569,2.691,4.099,7.707,0.501,0.451,2.22,0.778,1.018,5.315,2.973,1.408,1.905,4.332,2.218,5.384,1.344,7.954,3.929,1.24,2.551,6.011,7.174,3.691,1.17,1.269,8.815,2.615,9.801,1.365,0.668,4.829,0.98,9.165,4.957,9.002,1.494,3.315,5.063,1.066,9.266,3.43,1.369,1.203,3.897,8.183,0.325,8.109,5.95,1.127,3.199,7.375,7.074,1.594,1.989,4.364,3.223,8.848,0.336,1.088,6.173,5.328,4.147,1.491,1.83,8.389,1.345,3.503,1.649,0.189,6.045,3.748,5.59,6.583,9.066,1.792,4.789,3.895,2.073,2.086,0.829,3.314,9.639,2.302,1.579,0.607,3.109,0.495,0.036,4.864,4.15,0.927,0.119,0.174,3.219,7.906,7.336,1.521,0.865,5.589,1.645,2.772,0.89,3.639,9.312,6.234,4.343,8.631,5.137,5.821,9.336,0.182,0.863,0.807,6.672,4.527,1.218,3.825,2.097,0.852,8.762,6.814,3.99,3.768,0.417,0.127,9.233,1.346,8.159,1.189,0.731,0.291,0.708,3.015,0.451,5.935,4.826,1.192,2.776,1.082,7.007,6.398,5.614,1.371,0.188,3.714,4.293,6.067,5.443,3.501,5.472,0.158,4.928,0.492,3.409,0.197,0.7,0.796,0.157,0.68,5.204,1.57,1.762,1.352,3.667,0.672,5.974,3.375,0.846,5.489,1.294,0.399,2.436,7.915,5.437,0.658,8.126,9.3,1.602,0.466,2.945,7.034,4.662,2.802,4.267,0.217,3.691,3.125,0.182,2.14,0.198,3.189,5.379,1.092,3.699,1.652,6.675,3.815,0.368,0.111,0.43,6.238,4.419,2.706,1.821,6.81,7.59,7.914,4.309,5.781,8.19,0.87,0.938,2.026,0.605,1.551,1.017,1.193,7.251,6.267,0.915,0.328,0.266,5.43,5.303,0.665,4.472,4.719,2.635,3.238,0.773,0.11,2.175,1.649,2.437,7.3,5.704,2.342,4.349,1.885,0.253,0.619,0.332,0.742,0.17,2.546,4.081,1.211,5.035,2.923,4.152,3.603,2.886,0.177,6.454,3.318,2.171,0.473,7.682,6.5,5.753,0.146,3.934,4.8,2.041,4.634,3.315,1.589,5.688,0.321,2.229,1.109,8.956,2.37,2.024,4.782,0.652,7.47,2.958,1.618,1.823,2.614,4.512,7.61,3.56,5.423,1.416,4.733,2.737,0.915,1.292,1.429,0.265,4.506,3.597,1.066,1.284,1.333,2.09,3.232,7.119,5.44,7.974,0.095,0.952,4.691,0.217,3.05,5.523,0.761,2.166,2.68,0.2,7.914,8.81,1.46,1.317,0.792,9.056,4.344,0.383,2.039,0.205,7.835,0.164,0.836,2.234,4.798,3.408,0.389,0.673,4.159,4.962,3.503,2.32,0.242,6.14,5.113,2.107,0.104,2.98,0.2,0.68,3.363,0.439,5.129,5.584,1.376,5.055,1.883,1.808,0.524,7.536,1.853,3.305,3.649,0.996,7.866,1.039,2.519,6.002,0.507,1.968,3.793,0.642,5.176,4.745,3.258,1.265,2.285,3.195,1.734,0.884,5.238,7.891,0.284,1.808,0.575,0.242,3.027,0.199,0.57,0.324,1.733,2.385,1.719,0.79,6.885,2.008,1.504,0.96,2.933,0.194,0.497,8.909,9.367,5.194,5.805,5.419,2.142,7.729,1.043,0.088,2.126,2.28,4.03,3.382,6.217,0.269,8.463,7.929,1.103,2.247,6.838,4.421,7.724,0.281,7.964,6.028,0.814,1.876,2.372,0.651,2.058,6.077,0.779,0.792,1.312,0.235,9.633,1.187,0.462,3.272,4.01,0.823,2.926,8.015,7.069,0.626,8.575,0.533,0.446,0.263,5.49,0.581,7.463,5.192,1.301,4.318,0.639,8.202,0.76,6.024,0.127,7.18,1.103,3.467,0.106,0.352,2.277,7.133,2.207,0.265,6.367,1.195,0.274,3.943,1.32,1.536,3.066,1.656,1.176,0.281,6.595,9.09,4.019,6.188,2.931,0.259,0.121,2.085,0.605,0.959,2.651,5.202,8.86,2.401,4.272,1.14,1.546,0.537,6.25,1.235,2.541,0.889,3.705,4.796,1.566,3.835,0.809,4.821,3.164,8.237,2.865,4.1,1.914,1.859,1.711,2.656,0.722,1.862,4.695,0.193,0.203,5.224,0.31,5.962,4.172,0.444,1.412,3.553,0.792,5.347,7.752,0.693,1.543,4.293,2.512,5.11,4.128,1.878,0.617,0.562,2.753,1.759,2.068,5.853,0.46,6.492,4.294,5.276,3.477,1.364,4.798,2.144,1.22,0.615,6.746,0.724,0.23,0.444,4.553,2.562,0.802,0.593,5.995,2.554,0.441,7.651,9.001,2.809,5.692,3.205,6.882,0.59,8.872,6.934,1.536,4.347,1.389,1.738,3.747,1.731,6.264,4.943,6.779,1.09,2.533,6.99,0.912,1.726,1.732,9.085,2.797,6.19,1.467,3.475,5.147,0.359,5.333,3.272,0.516,0.833,3.353,2.756,2.369,1.435,9.561,0.378,6.2,2.177,0.277,9.454,1.005,0.613,0.699,0.35,0.29,2.914,0.959,0.325,6.93,9.258,3.312,7.486,1.08,1.784,7.271,2.392,7.206,0.777,2.675,5.174,0.171,4.689,7.465,1.286,0.746,2.887,2.736,0.147,7.083,6.043,2.828,2.974,0.304,9.058,0.175,6.198,1.265,2.66,7.001,1.348,3.492,0.53,1.505,0.441,0.796,4.224,1.587,1.25,3.307,0.359,0.964,1.378,0.485,0.415,1.162,0.942,3.909,4.829,0.913,8.118,1.147,9.624,7.525,3.062,3.425,6.418,6.076,8.186,0.477,0.103,0.389,3.049,5.179,2.278,9.848,8.179,2.871,8.624,0.116,0.298,4.877,4.861,0.499,3.478,2.086,0.325,0.468,0.455,2.811,2.008,2.499,4.044,3.409,8.692,8.642,0.629,4.077,2.048,1.737,6.611,2.977,7.493,3.29,7.962,1.001,1.183,8.16,0.206,9.344,3.225,0.938,7.44,8.151,0.144,1.651,4.626,1.057,1.559,7.604,5.523,0.257,6.986,1.098,6.942,0.421,3.706,2.853,3.991,7.175,5.537,1.513,2.692,6.449,0.325,3.338,2.723,1.468,4.589,0.693,1.765,3.084,4.283,0.345,4.202,1.074,1.57,3.763,6.228,0.581,4.582,1.01,0.339,1.476,1.86,7.67,3.781,4.629,2.881,2.693,4.665,0.09,5.705,4.928,4.985,1.182,1.114,1.106,0.399,0.053,6.06,0.879,6.685,6.43,1.111,8.472,5.518,2.949,1.315,0.195,8.596,1.374,0.396,7.473,8.927,8.053,2.226,0.299,8.773,0.377,1.685,0.331,3.26,8.107,0.129,7.135,5.727,0.733,1.572,3.065,1.476,0.243,5.518,2.55,0.908,1.518,1.062,6.978,0.674,2.428,2.896,0.45,7.802,1.454,6.26,3.995,0.616,1.24,0.56,1.66,2.896,2.344,7.573,1.953,2.154,6.474,1.055,8.1,1.961,0.546,1.73,3.457,4.184,2.227,5.165,9.696,8.017,6.916,7.256,4.054,1.199,6.586,0.727,9.184,3.491,3.567,2.138,0.221,0.158,4.257,2.002,3.353,2.14,1.842,2.584,4.373,4.956,0.576,1.89,8.772,2.909,3.333,3.072,9.618,0.484,0.31,1.945,2.805,0.26,2.682,0.783,4.138,4.843,8.242,0.602,2.782,1.862,0.99,8.57,8.088,8.608,1.103,0.329,1.203,7.224,0.823,4.53,1.069,4.904,3.894,0.539,0.345,4.773,4.641,8.456,9.54,0.45,1.894,3.01,2.488,6.234,3.925,0.238,0.249,6.855,1.905,0.653,6.023,1.868,3.89,5.771,2.105,3.981,0.382,2.235,8.533,5.272,1.833,7.851,4.126,1.15,7.219,0.819,8.094,3.263,2.078,0.558,0.3,4.8,4.361,1.32,0.26,9.394,3.196,1.344,1.264,0.205,5.515,8.66,3.604,0.872,2.528,0.956,2.741,0.631,5.49,2.775,6.41,5.965,4.766,0.707,9.683,1.273,0.717,3.393,3.181,3.919,0.516,0.182,0.381,0.335,0.088,0.138,8.096,1.455,2.211,0.116,2.557,2.175,0.56,1.072,6.527,2.338,2.75,5.008,4.344,6.842,2.543,0.573,1.151,3.448,0.288,2.58,0.345,5.136,1.959,2.537,3.675,1.169,8.786,5.818,1.678,9.197,1.267,1.069,9.612,0.699,0.502,0.23,0.091,1.804,6.032,9.271,8.555,0.528,2.601,7.168,0.741,0.417,2.691,4.129,2.3,2.967,5.137,4.768,1.699,9.794,2.632,0.468,1.095,0.505,4.829,3.411,0.283,0.159,2.018,0.626,0.438,2.314,6.694,1.713,1.667,1.415,8.401,5.82,1.368,5.154,5.594,0.571,0.585,1.189,3.828,1.231,0.422,0.422,0.45,1.611,6.773,2.699,0.231,2.753,0.171,3.083,0.163,0.283,2.044,2.622,4.752,4.515,2.194,9.279,2.612,3.947,1.186,8.796,0.814,1.998,0.473,1.025,8.099,7.368,1.428,4.911,4.31,1.431,0.546,1.399,7.183,7.188,2.028,0.93,0.359,0.229,3.133,5.736,0.191,1.11,0.102,3.122,0.252,4.755,0.134,9.881,2.398,3.487,5.399,0.217,0.894,0.738,6.355,5.45,1.089,6.236,2.511,4.939,9.642,2.206,1.892,1.273,0.18,0.354,2.214,3.625,8.003,1.283,6.076,6.444,4.227,1.667,0.977,3.109,1.114,5.863,5.863,0.507,9.19,5.031,2.624,3.692,2.804,6.148,0.678,2.197,5.042,2.217,0.973,8.356,3.869,4.514,5.719,6.464,2.27,2.512,4.087,5.873,0.268,1.922,1.181,0.259,1.532,0.555,3.658,1.546,4.71,2.414,4.019,7.687,2.912,2.093,1.447,7.056,2.735,8.284,2.631,1.77,5.434,1.266,6.123,0.544,0.196,0.217,0.411,0.902,9.438,0.817,3.198,4.713,2.579,1.8,0.236,0.361,4.342,0.466,2.748,9.845,1.084,1.178,0.76,1.659,5.308,0.168,4.188,0.752,5.21,6.761,4.482,1.963,4.135,5.158,4.749,2.415,2.492,5.644,8.695,6.229,5.021,9.138,2.842,6.584,0.657,2.598,4.668,7.449,0.294,1.905,0.108,2.726,5.659,7.091,0.959,1.86,2.796,1.291,4.867,0.484,6.196,0.737,3.986,1.136,3.715,3.447,3.754,0.664,0.459,0.975,3.082,0.205,7.789,1.371,5.96,2.453,4.5,9.414,5.622,4.129,0.573,1.715,3.131,7.372,4.866,7.4,5.305,0.506,3.217,9.747,2.148,0.693,4.367,1.458,0.567,5.003,8.896,7.83,3.714,2.146,0.477,8.315,0.27,8.689,4.948,0.279,5.25,4.569,4.789,4.294,8.024,6.753,0.195,0.663,0.839,5.57,8.209,1.619,5.633,0.679,2.892,3.852,0.294,2.058,0.521,3.581,1.65,4.841,0.418,6.324,0.223,5.159,1.176,5.732,0.948,2.114,7.139,7.5,3.048,5.558,3.091,0.303,0.164,3.411,4.503,4.263,1.117,7.488,0.917,0.21,2.558,0.083,2.366,0.96,6.225,3.231,2.182,2.095,5,0.296,2.459,9.264,1.431,1.726,7.113,2.735,6.742,8.197,0.463,6.036,9.237,8.886,9.311,4.493,9.058,1.442,7.268,1.322,3.831,0.647,9.181,2.296,2.389,0.32,3.677,0.417,9.182,1.142,1.259,6.404,1.63,5.182,6.806,5.086,7.698,8.225,6.135,0.485,2.771,1.363,0.519,0.74,6.959,3.228,6.113,0.197,0.406,2.293,5.022,5.195,1.167,2.134,3.116,0.64,0.452,4.987,2.196,0.168,0.313,2.823,7.029,2.932,5.677,1.13,1.071,8.13,5.663,2.94,0.182,9.176,1.508,4.086,4.983,1.23,8.288,4.414,2.242,0.405,1.467,0.367,3.208,1.284,3.382,1.409,3.823,1.352,9.059,4.441,1.466,0.137,0.436,5.187,4.156,1.978,7.815,7.813,1.73,0.3,3.28,6.903,0.475,0.852,5.278,0.591,7.116,7.09,3.864,0.673,1.292,2.18,2.242,7.957,3.871,0.102,5.728,0.584,6.449,2.255,7.371,4.185,0.119,4.75,4.336,0.103,0.808,6.864,0.729,8.032,1.896,2.152,1.235,5.224,1.309,8.293,0.606,1.443,0.081,5.704,1.264,4.274,1.123,1.373,6.73,4.987,3.75,0.182,1.317,1.133,1.316,2.15,6.869,0.929,0.836,2.562,3.969,2.945,1.32,9.016,7.155,1.133,1.58,5.102,2.025,7.965,0.953,1.486,1.41,2.385,3.57,0.387,5.343,2.751,6.991,0.332,0.423,1.177,9.109,4.484,0.516,3.583,0.335,0.22,4.956,6.645,2.089,2.781,0.164,8.89,2.453,0.436,0.497,7.612,3.45,3.765,1.886,2.432,6.56,0.536,4.824,8.433,4.303,4.485,5.446,0.797,1.191,8.407,0.19,8.63,3.542,1.619,1.506,3.312,0.416,6.427,6.989,6.526,1.589,5.221,0.835,0.218,9.019,5.167,9.192,0.287,7.787,2.493,0.72,2.812,5.337,2.481,0.937,0.791,0.661,1.971,2.246,4.379,3.512,0.511,3.403,4.169,4.415,1.592,7.498,4.155,0.069,1.336,5.242,4.474,7.646,2.772,2.619,2.296,1.748,3.075,0.333,0.29,5.453,3.008,0.888,1.388,0.703,4.711,0.803,4.208,0.422,1.8,0.892,1.716,0.325,3.241,4.884,5.989,5.242,0.276,8.217,2.913,7.119,0.343,6.578,5.558,0.22,5.054,3.319,7.323,5.402,6.782,4.506,2.628,7.504,0.682,0.621,1.926,5.495,1.039,0.616,0.446,0.505,8.667,6.685,6.818,6.41,8.013,5.345,0.441,2.12,2.977,0.529,7.029,1.801,3.084,2.05,2.318,3.087,6.474,3.096,1.755,6.518,1.67,3.24,0.48,1.938,1.968,6.112,0.74,1.447,9.714,0.174,0.984,8.385,0.881,3.752,0.687,7.813,6.903,0.664,4.638,0.113,1.894,6.295,1.321,2.885,8.14,3.316,3.712,4.493,2.363,2.412,2.765,1.224,6.491,0.849,0.535,0.75,1.842,0.259,0.557,2.147,0.276,1.335,0.917,4.436,5.542,4.618,0.385,1.305,0.376,2.69,1.45,1.143,1.794,0.121,8.099,2.156,0.922,4.178,8.317,6.91,1.405,0.212,5.942,1.407,6.73,6.711,1.285,7.643,0.512,3.876,4.864,1.841,2.14,8.08,7.004,4.008,2.371,6.503,6.581,0.074,8.085,0.215,5.9,0.582,2.448,6.292,8.268,0.951,1.037,1.875,2.926,0.073,7.547,0.304,3.991,0.719,7.345,0.429,8.786,2.129,0.46,1.481,0.569,7.082,1.557,3.887,0.49,4.984,8.716,3.493,3.444,1.144,1.188,1.403,5.143,7.981,0.384,1.604,4.51,4.724,0.163,3.871,2.383,2.708,0.638,3.124,0.543,0.528,5.247,8.316,0.445,6.188,0.873,5.484,0.667,0.439,0.157,3.337,1.939,2.662,1.117,0.849,5.38,7.569,4.095,2.428,1.559,0.905,3.79,9.289,9.697,0.452,0.623,4.977,1.587,4.754,0.257,8.965,3.515,4.729,2.34,0.874,3.222,7.269,7.442,1.126,5.303,4.237,2.638,0.843,1.934,2.318,7.462,2.067,2.521,0.824,0.318,0.221,0.937,0.584,3.077,3.601,0.656,5.071,0.897,2.045,5.922,1.363,8.681,0.775,0.75,6.312,6.88,0.821,0.458,0.287,0.135,7.479,1.629,0.195,0.127,2.796,9.046,1.77,2.151,5.678,7.12,0.37,5.764,0.676,8,7.233,4.358,0.095,3.917,4.822,1.58,1.816,0.038,0.16,6.852,4.897,8.273,2.932,6.543,1.375,9.671,6.452,1.926,7.731,2.155,0.685,0.933,6.013,4.404,2.323,3.521,5.702,2.691,0.703,0.233,1.621,7.055,0.352,5.437,4.009,0.503,1.88,6.296,2.908,3.976,5.65,0.064,3.713,9.936,0.294,4.25,5.609,1.625,7.248,0.176,6.542,0.152,0.353,4.305,1.631,1.253,0.193,0.638,0.339,6.481,7.72,0.916,0.654,7.072,1.318,1.331,8.239,1.136,1.856,1.451,4.133,3.014,0.4,8.372,1.741,1.965,2.071,1.4,1.286,2.756,1.925,0.444,3.801,3.397,4.195,6.29,0.688,0.282,1.698,0.292,4.745,2.857,0.951,1.968,5.257,7.566,8.093,0.975,4.77,3.459,0.734,1.072,1.023,4.348,0.584,3.591,8.411,7.303,1.28,4.377,3.701,0.292,0.864,0.206,4.132,0.624,2.478,0.909,1.086,7.444,8.533,8.049,0.473,6.172,2.164,9.142,2.394,5.807,1.403,4.846,2.687,2.476,6.813,1.794,3.669,4.4,1.913,7.805,6.118,0.294,3.581,1.273,4.261,0.723,1.197,3.131,2.539,6.228,0.204,1.532,9.553,8.753,1.584,4.024,7.574,1.785,3.292,7.55,1.11,2.865,6.492,8.018,0.211,0.64,1.628,6.768,0.198,1.033,0.629,1.815,4.241,6.059,1.504,2.104,0.621,7.323,8.825,2.887,0.649,0.45,4.126,0.966,7.143,0.935,6.011,1.008,6.929,2.222,2.949,3.935,0.585,0.824,0.44,2.741,3.724,5.306,0.24,3.971,0.681,1.399,5.763,0.48,2.259,0.345,0.996,0.98,3.843,2.589,5.604,7.104,3.713,2.847,4.315,6.637,3.518,1.996,4.902,0.605,0.981,7.322,0.377,1.155,6.085,1.363,0.507,7.285,0.153,7.543,2.183,1.935,3.483,3.65,0.179,0.45,1.628,9.276,1.919,4.438,4.402,0.32,5.422,5.617,3.19,5.238,3.33,0.32,2.689,1.415,0.26,4.705,6.215,6.038,5.172,1.879,5.724,1.332,4.187,8.669,0.944,0.218,1.469,6.575,4.484,3.051,4.276,5.604,0.223,0.215,5.106,9.988,2.637,6.394,2.348,2.016,2.128,5.64,4.879,3.448,0.625,0.688,7.683,1.906,1.581,9.094,2.434,0.463,4.024,0.241,0.331,0.165,2.67,1.167,8.911,4.681,0.215,3.589,0.13,2.261,6.38,0.908,0.537,1.114,0.619,1.14,0.151,9.089,2.346,0.466,5.158,3.397,0.944,4.318,0.344,4.561,4.328,0.969,2.458,6.319,1.451,6.839,3.356,3.976,1.017,8.084,6.465,2.986,1.012,1.93,0.59,3.938,8.7,7.712,0.144,0.843,2.181,9.012,3.139,0.351,7.42,1.651,0.947,1.43,0.222,0.949,3.312,1.079,8.176,3.387,2.419,6.208,0.162,5.719,7.331,0.485,1.04,0.695,2.168,7.555,0.84,0.299,0.608,8.521,0.313,7.766,5.414,2.145,6.411,3.812,3.601,1.001,4.303,6.634,7.57,6.943,2.961,3.081,1.907,0.489,0.293,1.848,0.527,0.203,2.864,3.569,1.64,2.95,5.776,1.245,0.163,8.899,0.759,5.054,1.441,4.683,1.06,0.345,6.61,0.219,0.568,4.377,1.913,3.455,3.518,2.735,4.453,0.855,0.561,5.176,0.803,7.202,1.629,5.733,1.749,2.323,1.247,6.671,2.725,2.096,3.828,0.766,5.639,2.903,2.083,4.51,1.673,0.221,2.038,1.498,9.019,6.45,0.504,1.643,2.096,7.199,2.324,1.214,0.699,1.714,7.514,2.781,4.666,0.653,0.316,8.274,2.547,4.285,6.79,6.624,9.197,5.82,2.555,0.243,2.111,0.348,0.151,1.733,0.641,0.392,5.558,3.465,7.495,0.344,0.162,4.152,0.482,5.309,6.956,0.067,5.704,1.087,0.148,0.269,8.52,5.907,0.927,5.057,4.385,2.221,1.986,6.61,0.424,2.891,1.676,0.283,2.716,4.065,0.223,3.782,1.986,5.372,3.604,4.556,3.181,1.841,6.732,0.634,2.184,0.514,2.59,3.006,5.722,0.325,7.957,2.888,1.042,2.299,4.999,1.869,0.143,4.84,2.698,0.281,7.082,0.914,0.734,0.428,0.121,5.607,2.189,1.682,5.696,3.126,9.156,0.118,3.68,5.29,7.554,0.623,3.305,4.98,2.83,4.009,1.085,5.505,4.135,3.676,7.135,0.275,4.031,4.864,0.235,5.243,1.61,0.118,1.828,5.591,0.378,7.661,4.318,2.298,0.241,0.255,2.263,8.121,3.477,5.751,2.133,0.801,6.717,4.659,3.134,5.541,5.214,0.953,3.401,0.217,8.602,0.864,6.539,7.988,0.248,0.675,0.122,5.837,0.372,0.074,0.064,5.935,6.441,2.517,7.38,1.702,5.737,6.556,6.911,9.098,3.069,1.133,9.196,1.719,2.847,1.891,7.033,7.682,3.065,3.07,3.418,0.674,6.858,2.434,4.53,1.653,0.829,0.8,4.7,6.447,0.622,1.34,1.508,0.05,6.231,3.096,5.187,3.557,1.585,4.801,6.491,0.385,3.132,8.679,5.003,1.313,0.311,1.41,4.241,8.182,0.294,0.256,1.929,2.537,5.871,1.077,1.816,1.914,1.078,1.19,4.987,5.075,4.163,1.704,2.106,0.717,0.173,2.214,3.744,5.92,7.797,3.741,0.217,3.382,5.389,1.159,6.294,5.479,0.575,0.744,1.947,2.969,7.482,0.277,3.936,0.199,2.257,1.765,3.013,0.71,5.173,3.955,0.537,2.47,3.732,0.549,0.259,0.623,0.124,7.106,7.736,0.974,1.351,0.372,4.637,2.883,1.257,5.106,3.592,1.508,2.782,7.804,0.681,3.056,0.527,0.628,3.204,6.429,2.375,4.598,3.061,0.065,2.565,0.666,0.532,0.446,8.406,1.814,0.696,5.927,3.767,1.54,2.782,2.459,3.528,2.636,0.578,2.696,2.932,0.331,1.204,2.674,5.458,1.1,2.65,5.022,1.161,6.263,7.359,0.257,8.508,2.564,8.395,0.093,1.159,5.553,1.067,0.134,5.018,3.202,3.052,7.582,5.382,2.104,0.763,8.017,0.379,0.259,5.281,5.007,0.412,7.862,1.512,1.876,5.512,6.66,1.589,7.789,1.518,1.914,2.942,8.168,2.336,4.309,0.366,6.079,6.967,7.304,6.359,6.516,0.923,2.38,5.635,7.214,2.712,7.779,2.384,1.091,0.157,0.952,4.937,5.204,5.725,9.076,0.877,1.295,8.921,1.631,3.485,4.08,2.247,5.174,0.43,3.958,3.119,9.064,1.212,2.38,2.841,2.013,0.587,2.976,0.123,2.897,0.646,1.588,0.353,2.789,4.474,7.683,2.786,9.509,0.192,0.191,0.954,0.212,3.885,5.35,2.876,1.081,2.554,4.537,1.601,0.396,0.193,2.347,2.464,1.318,1.566,2.242,8.353,0.399,0.559,1.061,5.263,8.626,6.506,2.021,6.684,6.123,9.467,0.312,1.474,3.119,3.785,1.075,7.128,7.405,9.105,7.936,2.522,6.393,0.297,5.497,6.666,4.821,3.002,0.258,9.197,2.152,2.549,3.227,0.678,0.09,8.76,4.825,2.722,5.057,1.168,3.365,8.396,1.195,0.791,1.576,4.175,2.536,0.632,2.101,3.306,8.025,7.212,0.135,7.513,6.569,4.252,6.019,2.704,5.311,0.271,7.333,4.221,4.933,9.439,3.361,2.296,8.916,5.059,0.646,0.356,0.113,2.702,7.374,8.265,4.388,2.959,3.8,1.408,0.194,1.556,0.464,3.682,0.197,0.691,0.084,0.087,6.569,3.31,9.21,5.116,3.178,0.425,0.903,5.639,1.48,0.311,2.86,0.49,6.278,0.163,1.662,0.308,3.419,0.554,6.245,0.31,0.485,7.966,8.094,0.856,8.571,2.974,5.319,7.041,1.478,0.107,4.422,6.804,5.381,0.582,4.516,1.822,0.951,0.263,7.503,2.844,3.407,0.191,0.404,8.896,1.211,3.655,6.888,2.204,0.643,0.479,0.828,1.662,3.457,2.237,1.21,1.267,2.09,1.561,6.446,1.779,5.732,1.709,4.851,6.352,4.766,5.231,7.899,3.586,8.584,1.386,1.583,9.245,0.558,0.411,0.237,2.957,0.784,4.976,2.386,7.422,2.525,8.602,0.327,1.471,5.079,1.013,1.15,0.198,0.159,6.2,4.753,6.361,3.83,0.906,9.156,1.85,7.203,7.637,0.783,7.347,8.81,6.059,5.245,5.754,0.413,2.909,0.54,0.185,1.674,2.86,1.583,4.358,8.066,0.103,1.765,0.732,1.442,3.035,7.314,0.723,4.344,9.425,2.419,3.294,9.855,0.18,8.027,1.221,1.158,2.742,0.492,3.841,4.37,0.17,0.987,0.576,1.617,4.51,1.023,3.197,0.464,6.524,4.928,3.517,2.343,0.794,0.217,5.479,2.71,0.594,0.415,1.817,1.519,0.993,3.274,2.652,7.896,5.109,0.361,5.879,2.855,0.069,0.744,4.154,4.443,0.282,0.265,0.788,2.843,7.799,0.319,0.692,0.844,0.407,0.139,0.518,2.619,5.07,2.83,9.525,1.359,0.094,4.098,2.27,1.356,4.951,5.283,1.371,0.844,0.145,7.5,0.423,7.056,0.298,1.53,2.008,5.43,4.43,1.189,4.141,6.484,5.09,0.115,4.927,1.908,0.79,8.186,0.89,3.315,0.464,2.65,2.116,0.151,9.484,1.08,2.829,4.935,0.233,2.056,0.158,3.381,1.163,9.372,5.053,4.378,6.673,0.153,1.013,1.01,0.104,0.892,1.3,2.652,4.015,3.321,3.338,0.213,3.193,4.898,6.012,1.279,0.193,6.311,2.048,6.281,8.075,8.153,1.807,5.269,0.408,1.188,4.54,1.36,0.625,3.428,6.894,1.477,7.833,0.795,3.034,4.367,6.512,4.567,6.273,1.184,0.423,0.843,0.152,1.901,0.412,1.969,0.148,0.673,0.201,1.128,1.941,0.24,2.696,4.138,4.2,0.437,6.26,0.274,8.248,1.3,1.514,0.851,0.356,1.51,0.123,6.951,2.279,9.548,1.574,1.031,2.733,4.215,6.703,0.853,3.224,4.882,0.879,0.361,2.99,3.289,1.196,8.105,7.229,0.551,0.335,4.611,0.657,5.899,6.779,0.185,4.803,0.302,0.88,2.029,2.53,8.311,5.745,1.505,3.079,1.629,7.564,0.519,4.132,0.694,1.873,0.122,8.969,8.71,3.912,1.09,9.214,1.6,0.98,2.124,1.144,9.359,0.218,0.635,0.321,8.955,0.335,3.681,5.218,0.484,3.712,0.958,3.067,1.766,5.309,3.439,0.351,1.605,6.02,3.469,3.071,2.968,1.466,2.247,1.128,4.388,1.64,5.833,2.135,0.491,3.208,5.21,2.087,2.478,1.083,1.089,3.797,1.026,0.214,7.482,2.403,0.154,2.693,4.771,6.506,1.474,2.821,1.888,0.334,3.878,9.418,1.215,3.579,0.387,2.329,6.44,4.407,0.808,1.201,8.738,6.357,0.292,6.242,0.309,8.844,1.804,4.81,2.088,0.346,0.519,0.716,0.348,0.225,1.755,9.712,0.218,2.805,1.367,0.579,0.482,0.42,1.018,8.249,3.785,2.837,3.662,6.539,0.167,0.508,3.075,5.275,3.551,7.677,8.575,0.173,2.061,6.401,0.291,5.977,1.342,2.065,3.761,0.113,5.665,3.329,2.779,0.545,1.747,6.425,7.997,3.879,2.753,6.843,1.697,1.746,1.569,6.27,1.755,8.42,5.203,4.619,3.607,1.174,3.065,4.165,9.287,2.513,0.227,1.56,9.1,4.801,7.693,4.74,1.256,6.194,0.252,3.584,3.538,1.826,3.707,3.292,2.94,3.165,0.121,7.527,0.211,6.979,2.887,1.289,1.915,1.566,6.21,0.148,8.169,4.468,0.933,6.36,1.494,4.618,0.333,0.156,8.599,2.114,0.355,7.833,5.17,3.38,4.383,0.803,2.458,2.554,4.023,4.603,2.945,9.351,0.605,0.923,0.926,8.872,3.755,6.452,0.939,2.762,2.205,4.813,1.41,1.365,0.34,7.786,0.546,8.95,6.161,7.165,1.357,3.752,4.883,7.797,6.126,7.226,1.254,6.627,5.112,6.714,2.744,0.171,2.406,8.57,0.826,4.618,0.892,0.361,0.909,7.672,1.779,3.422,2.792,0.231,4.58,7.499,0.109,2.975,0.568,0.555,7.992,1.04,0.981,4.058,0.44,8.837,4.034,0.588,3.44,8.745,4.57,0.492,5.524,0.123,2.876,8.073,1.342,2.294,0.104,2.629,0.666,3.727,4.698,1.062,6.168,7.485,6.201,7.945,6.122,3.956,8.329,1.329,1.152,0.754,9.375,3.483,5.239,0.865,4.266,5.351,1.283,6.58,0.685,0.58,3.482,2.256,0.916,0.505,0.547,6.284,8.942,3.052,1.744,0.972,4.415,4.083,0.917,6.337,0.463,1.18,0.142,0.467,1.959,8.571,1.079,5.635,3.722,1.139,4.175,3.518,0.242,8.662,1.156,6.318,3.536,0.501,0.79,1.461,6.261,7.754,5.85,0.451,4.724,6.842,0.355,4.795,1.871,2.978,1.126,1.864,3.477,9.047,0.18,0.247,3.144,1.995,0.411,1.958,7.828,0.295,0.254,5.896,0.714,3.897,0.915,6.107,7.24,8.827,2.365,5.576,6.643,2.461,0.192,7.88,0.347,0.148,0.497,4.779,0.98,0.3,0.833,2.73,0.592,2.728,4.22,0.197,1.332,0.645,0.71,2.701,2.312,4.145,1.592,3.717,8.404,9.43,9.44,3.526,1.551,1.168,0.363,6.43,0.553,8.79,8.214,8.925,0.704,1.029,0.441,1.192,1.402,4.802,6.068,4.123,2.121,3.281,0.85,5.81,7.912,8.907,0.24,0.323,1.475,3.902,5.181,0.205,1.475,2.546,9.053,7.22,0.949,3.19,3.239,3.667,0.13,1.19,5.123,6.769,1.083,3.142,5.691,1.181,2.012,5.265,0.402,0.379,0.579,2.595,2.037,2.62,1.271,5.625,0.374,1.085,0.725,6.557,6.733,8.907,2.779,0.242,9.12,3.962,0.243,4.792,8.864,0.213,0.486,9.388,9.164,1.242,0.941,2.867,2.928,2.028,0.135,4.757,1.935,2.268,4.659,0.188,8.06,0.064,0.118,0.861,7.786,3.108,7.647,7.066,5.759,7.383,5.871,0.242,4.585,3.314,2.914,0.096,6.839,2.699,8.731,0.188,8.644,0.741,1.941,1.701,5.702,4.514,2.288,8.031,1.317,2.705,2.375,0.222,2.241,3.541,3.9,0.551,0.345,4.557,5.93,9.967,1.044,2.737,1.333,3.418,9.385,6.021,2.111,0.716,4.493,7.766,8.573,6.513,1.014,4.239,0.432,0.551,3.739,1.134,0.98,0.968,6.957,1.731,7.173,3.242,4.541,0.133,8.29,4.301,0.569,0.672,2.453,0.759,3.518,4.307,1.39,1.584,6.399,6.351,6.701,7.729,0.137,4.587,5.272,7.128,8.753,1.291,0.615,4.959,0.82,1.765,1.803,0.473,4.026,3.121,6.103,0.664,0.482,1.701,1.972,2.104,0.668,3.917,0.639,2.35,2.968,5.356,7.008,0.554,6.901,3.724,8.668,2.783,1.393,2.036,1.882,2.526,2.042,2.107,4.634,1.336,0.059,7.585,1.858,5.661,9.114,2.214,2.977,0.676,0.868,7.913,0.304,2.672,1.79,0.702,0.109,0.156,2.749,2.197,6.664,1.467,1.149,1.02,8.701,6.235,0.59,0.713,6.341,5.349,3.031,0.456,5.461,0.49,2.999,5.682,1.73,3.875,0.855,6.299,2.132,1.144,0.037,1.738,1.196,4.746,4.286,1.694,4.253,1.036,4.033,5.792,3.171,6.912,2.451,1.815,6.391,0.526,0.879,4.444,0.332,3.815,0.737,0.89,7.693,3.027,8.716,4.57,6.785,0.23,2.702,0.243,6.379,4.297,0.174,0.628,6.889,1.889,8.062,3.074,3.609,4.31,8.977,7.496,6.918,4.935,8.979,2.068,1.579,4.036,1.068,4.595,9.081,1.731,7.59,6.209,2.066,3.187,1.065,2.196,9.023,4.771,0.383,5.138,1.957,4.916,4.623,0.597,0.502,5.349,0.27,4.392,2.733,2.927,2.881,2.206,1.588,2.255,0.196,0.467,1.071,8.249,2.674,0.487,5.349,0.698,1.729,5.782,1.713,3.374,7.558,1.255,5.626,5.098,0.546,2.916,1.291,4.812,6.719,0.225,0.906,1.237,3.198,0.136,0.737,8.76,4.436,1.014,4.45,0.409,5.676,3.65,3.338,1.49,2.442,0.442,4.446,3.036,0.266,1.925,8.707,3.318,4.12,6.834,1.348,0.366,0.739,0.136,4.04,2.365,0.474,4.912,1.065,1.472,9.099,2.168,0.784,0.944,0.688,0.414,4.028,5.741,3.069,8.918,4.6,0.57,8.639,0.134,1.773,8.706,1.051,3.136,0.932,0.546,7.52,0.806,8.767,0.386,1.518,7.082,7.161,0.473,1.127,6.803,0.636,1.325,0.242,4.128,3.178,6.54,8.117,8.931,4.479,0.317,0.586,4.895,5.16,6.25,4.92,2.783,2.674,3.967,3.145,6.681,5.697,6.741,4.915,6.476,0.136,1.258,4.066,5.157,4.791,1.291,9.694,0.405,7.838,7.638,3.132,6.867,4.306,3.291,2.641,2.529,1.603,4.764,2.421,1.423,1.45,4.726,1.261,1.546,1.463,5.159,4.031,6.032,4.941,2.643,1.257,6.522,4.089,0.798,1.025,3.201,6.968,7.819,0.252,2.138,0.302,0.118,0.377,2.535,1.045,5.595,3.152,5.03,7.757,0.619,3.578,3.776,1.793,2.393,0.728,3.585,1.076,0.175,5.793,0.439,5.36,2.822,7.279,1.681,0.865,1.666,1.026,6.918,9.486,5.232,5.159,5.756,1.59,5.721,4,0.45,0.114,0.842,3.29,0.51,3.099,8.39,4.357,4.873,0.313,2.418,8.889,3.967,2.511,0.391,1.309,0.108,4.883,5.503,7.924,2.39,9.111,1.053,0.611,3.75,1.189,1.868,7.675,4.812,0.792,3.469,9.902,5.22,0.531,1.904,0.54,2.902,7.518,0.679,9.112,1.583,1.931,1.141,3.407,1.507,3.582,2.758,1.624,4.166,0.747,0.413,1.773,0.657,2.105,1.636,0.552,5.327,0.316,5.468,0.639,6.938,8.452,9.337,0.581,1.939,2.908,0.75,3.272,3.56,0.859,6.234,2.996,1.973,0.152,2.25,5.685,1.675,8.081,5.772,0.58,1.738,8.906,1.756,0.043,9.53,4.655,5.147,3.373,0.061,3.62,6.876,5.638,0.26,0.853,4.354,1.118,1.034,9.477,0.82,3.95,7.266,4.481,4.611,8.124,1.699,3.001,1.808,8.975,2.915,8.659,0.827,0.505,1.949,2.121,7.181,0.895,0.068,0.417,1.096,7.545,5.202,6.003,1.317,4.036,5.318,1.74,5.189,4.23,8.029,0.197,8.963,0.817,0.654,1.909,3.069,4.305,8.383,1.014,0.499,5.23,1.21,2.747,0.305,8.738,6.179,0.262,0.153,0.205,0.288,0.3,2.186,4.19,3.041,0.296,3.359,9.083,1.126,3.173,4.125,7.195,3.235,1.033,0.124,3.211,3.84,2.3,6.018,8.627,1.516,1.115,1.353,8.368,4.031,0.981,4.184,1.958,5.476,2.13,0.475,3.782,2.473,6.25,0.761,3.222,0.709,2.193,2.308,3.982,1.133,0.852,9.188,2.853,0.415,5.491,8.467,7.046,0.897,2.352,0.48,0.573,2.514,2.518,5.108,9.399,6.406,3.227,0.109,0.317,6.822,8.087,8.929,0.392,3.299,8.419,4.602,1.835,0.423,5.408,0.352,1.539,6.637,3.189,5.705,1.148,5.776,0.144,6.123,7.569,4.491,2.386,4.72,1.112,0.291,4.57,2.812,0.619,2.168,1.473,5.425,3.554,3.312,2.064,5.936,0.204,2.725,1.092,2.064,1.607,1.085,1.817,3.399,0.623,2.989,0.291,4.465,0.24,2.105,4.886,0.783,1.022,2.309,4.534,1.553,1.59,0.327,2.431,2.569,2.258,1.07,8.798,0.864,0.242,5.604,1.68,3.051,6.072,1.533,5.027,1.398,4.435,7.656,3.519,2.572,8.185,2.888,3.774,0.731,0.225,0.529,2.419,0.882,8.149,6.918,2.336,5.813,8.286,2.291,2.432,1.467,1.501,0.572,0.234,8.443,2.9,2.761,2.126,3.323,1.712,6.61,2.104,0.118,2.527,3.46,1.996,3.921,2.235,0.144,2.579,7.932,8.954,4.27,2.803,3.038,1.13,1.588,0.673,1.865,0.541,9.444,7.87,0.339,4.168,0.515,1.855,6.337,9.319,6.989,0.506,2.028,3.501,0.523,1.267,4.05,2.115,1.862,1.096,0.241,7.753,3.377,0.677,3.296,4.672,0.573,9.371,4.628,3.631,5.369,0.452,0.841,0.358,0.282,9.635,0.854,3.4,4.916,7.017,0.699,0.36,0.231,6.53,3.512,4.067,1.772,1.041,0.334,0.211,2.91,1.486,6.3,0.421,3.542,1.104,6.124,1.36,3.838,4.796,8.375,5.602,2.253,0.771,2.329,5.735,0.458,8.681,3.03,0.434,9.159,8.144,0.171,4.201,2.164,1.599,4.046,0.835,0.331,3.63,1.199,2.978,0.828,2.751,6.218,0.505,8.249,1.627,3.9,6.496,0.201,5.955,2.549,3.976,8.812,5.031,0.608,1.087,2.892,0.897,8.188,3.216,1.322,4.197,0.668,4.459,1.697,1.464,4.394,1.679,7.536,0.226,0.224,1.08,0.714,0.583,0.889,4.838,3.245,0.806,1.771,0.671,2.001,5.956,5.57,3.626,9.294,0.832,5.409,0.703,1.166,9.24,9.337,1.012,2.358,9.203,0.758,0.173,2.212,0.771,5.333,3.422,8.372,0.082,0.265,0.67,2.621,3.497,1.072,0.84,5.893,2.859,0.349,0.271,0.392,1.442,5.072,1.224,3.624,6.549,6.452,0.286,2.457,1.933,0.186,7.989,0.862,6.503,0.25,6.852,0.872,0.168,1.224,3.249,8.47,9.261,4.434,1.781,1.517,8.511,2.101,2.863,1.242,0.102,1.472,1.32,8.155,3.076,0.137,6.127,0.512,0.611,1.563,7.875,1.78,0.696,1.189,6.463,6.505,2.385,2.781,3.153,2.64,0.406,1.686,2.731,0.176,3.273,0.108,4.133,3.034,0.231,3.868,2.569,0.318,0.799,0.363,2.553,2.746,0.221,5.572,1.534,5.059,0.146,3.322,3.084,0.718,6.947,1.635,0.832,2.71,3.554,2.812,8.455,0.77,0.862,1.94,2.974,7.853,1.542,2.185,2.164,0.315,2.655,0.543,2.733,3.291,0.375,5.78,5.472,7.652,1.617,5.801,1.44,0.232,0.445,5.9,1.143,8.576,3.045,0.249,9.836,4.015,0.103,9.371,6.879,5.042,0.095,0.637,2.734,1,7.313,1.867,3.307,3.064,4.016,8.897,0.688,2.434,5.88,6.759,6.478,0.201,0.878,0.831,3.477,9.158,7.311,4.688,2.456,3.322,2.571,8.477,2.474,0.919,4.097,0.903,6,0.787,2.578,0.554,7.153,7.34,0.844,1.207,3.574,0.308,1.842,1.172,5.786,0.654,8.035,0.195,4.969,9.386,4.936,2.116,5.062,2.273,0.283,2.183,3.539,3.805,1.973,4.128,4.415,3.649,1.224,0.473,4.132,7.691,0.641,3.714,5.632,6.152,3.394,6.617,0.953,5.206,2.331,8.813,2.391,2.273,2.212,0.102,6.924,4.569,4.618,0.529,1.433,0.403,8.565,2.413,3.341,0.994,1.134,6.4,1.378,3.506,6.421,2.896,6.311,1.907,8.164,6.611,7.595,4.451,3.118,6.748,5.236,9.015,3.43,0.574,0.671,6.105,1.895,0.686,2.15,5.34,7.997,8.088,0.369,5.698,6.247,2.022,3.589,9.268,0.182,3.537,6.103,1.388,5.51,0.728,0.326,2.823,1.806,3.184,6.905,9.147,1.458,2.045,6.365,2.469,7.017,0.274,2.542,0.4,3.538,9.559,2.151,8.915,0.655,3.519,6.152,3.655,4.42,3.285,5.215,3.145,9.504,0.339,7.747,7.049,0.827,3.229,2.582,2.85,5.885,0.145,4.705,3.313,2.127,8.359,1.408,1.684,0.636,4.649,0.853,1.644,6.22,1.882,1.933,4.875,9.462,8.641,1.326,1.878,1.932,3.962,9.67,0.072,0.277,0.231,9.504,0.139,5.801,1.113,0.823,7.332,7.633,4.297,3.333,0.091,9.081,4.171,2.171,3.633,0.117,7.983,0.351,0.503,0.96,7.366,2.641,0.433,1.542,3.351,0.873,4.686,0.248,3.142,0.903,1.804,0.193,2.875,1.407,0.569,8.507,1.102,0.222,2.932,0.187,0.917,6.61,0.199,4.533,3.922,2.062,1.122,2.79,0.568,0.117,0.131,0.271,0.434,0.975,4.821,6.312,1.843,1.778,2.205,2.853,4.494,9.006,1.749,8.472,7.782,2.92,5.018,3.732,1.419,2.87,3.082,0.522,5.483,0.212,0.85,1.675,0.56,7.504,8.967,0.514,0.095,0.392,8.162,4.882,7.323,5.671,4.375,0.318,3.087,0.584,2.654,5.766,7.189,0.05,5.562,2.639,1.861,3.634,2.633,5.634,1.165,2.524,9.055,2.358,3.318,6.196,2.935,0.863,0.503,7.39,1.027,7.716,1.094,7.009,4.657,3.626,3.788,1.784,4.31,0.596,0.27,1.864,4.458,0.641,7.785,2.357,2.1,1.929,6.626,1.083,0.68,2.153,4.53,8.014,9.512,6.486,7.621,1.84,5.527,1.034,4.142,1.028,1.611,2.162,3.506,7.944,0.231,2.132,1.858,4.392,6.428,1.536,0.786,1.204,0.724,2.794,8.83,3.394,8.647,3.629,3.814,2.46,2.739,5.646,8.533,4.044,0.379,1.371,8.798,1.468,2.578,4.752,7.076,1.282,1.618,4.169,3.727,8.807,3.712,2.045,2.569,0.455,0.533,9.273,2.402,6.749,0.517,8.087,2.273,1.343,1.927,3.117,2.258,0.646,0.92,1.14,7.303,5.793,9.018,1.62,2.602,0.251,7.871,6.432,8.244,6.118,4.706,4.873,8.734,2.426,6.534,0.223,3.158,3.728,0.744,9.156,7.54,0.719,8.629,2.225,0.487,0.568,4.253,0.816,2.366,0.511,3.5,5.375,0.859,0.723,3.565,0.144,4.452,1.324,0.41,0.413,2.591,3.27,2.565,3.403,3.455,3.883,4.656,0.618,1.599,8.396,0.234,7.531,1.996,0.466,6.505,2.816,4.056,7.827,1.44,6.602,6.082,8.845,0.063,1.01,0.593,2.877,2.998,0.326,2.827,3.088,1.868,0.317,4.826,2.466,4.973,4.877,0.546,2.004,3.838,4.717,1.064,6.523,3.849,3.255,5.335,9.458,2.723,9.381,4.953,2.724,5.523,1.852,0.613,0.736,3.751,5.265,4.23,1.252,0.691,2.989,0.364,1.684,1.822,0.914,0.469,2.956,3.719,6.544,6.398,3.171,0.765,3.609,4.545,9.611,1.251,1.415,6.654,9.455,9.385,5.067,5.801,3.058,2.414,2.745,7.272,7.409,3.232,4.859,6.603,0.926,3.327,7.012,0.689,0.86,2.365,2.23,2.925,4.348,1.772,5.9,2.274,3.56,6.842,0.356,9.19,3.233,2.616,2.792,3.235,3.316,2.494,2.79,8.357,4.611,0.276,1.815,4.336,2.75,4.953,1.483,6.348,1.39,0.334,0.313,1.492,7.106,0.226,2.318,6.873,6.777,4.54,0.425,0.394,0.37,1.36,7.995,0.777,0.606,3.18,2.332,0.169,3.438,0.205,1.928,3.304,7.685,1.127,8.031,1.658,2.233,0.655,2.338,1.871,0.989,0.458,2.985,1.794,8.249,1.833,4.017,9.652,6.204,5.863,7.332,2.697,3.424,1.344,3.229,5.772,8.596,0.053,1.191,1.242,1.851,3.388,6.732,2.023,9.324,0.713,2.735,5.357,5.862,0.689,8.05,1.426,4.671,5.345,7.93,1.137,4.002,2.109,3.276,5.415,1.289,6.648,3.298,5.353,3.612,0.173,0.364,9.093,4.577,1.081,2.08,3.831,1.315,7.001,4.23,2.016,2.949,1.892,0.366,7.689,8.166,1.084,0.843,7.111,2.005,8.246,2.537,0.744,4.079,0.382,0.488,9.385,1.561,2.525,7.922,5.566,7.189,2.117,1.264,5.128,0.329,6.595,3.547,0.649,0.257,2.384,2.587,0.133,7.539,1.644,8.213,5.155,6.763,4.18,1.29,1.605,0.524,1.552,3.67,2.216,2.126,7.297,5.134,0.262,9.113,3.045,0.5,7.634,0.749,0.986,1.769,2.522,6.749,1.055,0.084,1.431,0.47,6.248,0.562,5.296,1.059,3.186,1.43,3.494,2.784,3.279,2.162,2.954,5.828,8.458,1.49,0.215,5.329,1.537,6.941,2.653,0.326,0.655,4.377,5.336,6.208,7.024,2.934,1.958,4.102,0.629,2.754,0.115,1.008,0.406,2.674,4.571,4.045,5.52,0.672,4.27,5.733,1.411,4.77,2.098,1.824,2.664,6.566,3.507,2.138,4.63,3.4,1.389,3.356,1.11,9.747,1.298,2.258,2.527,0.648,3.828,5.068,3.758,0.315,0.32,2.906,0.323,4.629,7.557,6.973,1.012,0.595,1.969,0.758,3.914,8.189,0.094,8.184,3.23,3.126,6.739,0.39,3.878,2.182,2.052,2.805,2.114,7.478,0.371,4.984,0.23,7.076,1.233,3.132,4.564,0.565,2.82,3.713,3.814,2.419,1.038,3.261,4.789,2.221,5.593,0.825,0.349,5.29,1.412,7.628,0.165,6.502,0.653,1.938,5.287,6.923,0.102,6.102,1.682,0.327,1.157,3.716,4.906,9.033,5.723,3.026,1.307,0.317,1.886,6.157,8.804,1.187,3.507,6.989,6.616,0.235,4.896,3.846,0.278,1.685,1.272,1.562,1.715,2.993,4.325,1.577,0.398,0.384,4.424,6.68,0.232,3.769,6.155,6.841,0.752,1.479,4.457,0.157,4.656,3.581,3.571,6.39,1.137,5.794,0.139,8.25,4.267,6.719,4.043,0.961,7.994,7.345,1.53,8.941,0.918,0.452,0.095,0.598,5.139,0.901,9.372,0.696,0.993,5.744,0.97,6.004,2.253,3.009,0.339,7.309,7.659,5.012,0.828,2.596,2.367,8.515,9.269,0.108,4.094,1.707,6.53,2.766,1.336,0.514,0.221,2.205,2.581,9.076,1.25,0.915,4.445,8.626,0.505,3.62,8.041,3.375,9.773,0.481,4.223,1.112,8.032,2.382,0.239,1.654,1.189,0.851,4.397,8.758,6.113,5.36,3.648,5.192,4.926,0.362,2.971,0.4,1.429,2.111,0.505,6.702,1.316,6.732,5.03,7.075,0.313,1.025,1.617,0.663,1.553,5.684,3.826,0.364,0.327,7.462,5.52,0.101,1.255,8.35,7.782,0.518,6.392,2.807,3.892,2.108,1.531,1.509,0.292,1.334,6.492,0.872,1.75,3.676,7.497,3.727,5.034,0.682,3.215,9.052,0.779,9.31,1.109,0.551,0.143,0.719,0.505,5.231,4.469,7.421,3.012,2.448,2.985,0.725,8.235,2.855,4.793,0.593,1.388,0.463,0.33,0.548,2.378,0.701,0.95,4.961,4.078,0.81,7.224,4.607,3.217,0.989,0.462,1.64,0.36,2.796,0.921,0.288,2.216,1.196,5.128,8.465,3.163,1.106,2.546,0.88,1.898,1.521,3.529,1.43,5.401,1.897,4.829,5.423,0.109,5.447,4.187,8.56,0.3,0.342,7.35,0.53,0.763,3.853,1.167,0.883,5.944,2.63,1.534,2.576,5.023,4.073,4.033,2.271,0.449,7.784,1.036,2.314,1.116,1.03,1.376,1.267,0.606,2.557,0.93,8.843,0.546,7.6,0.786,7.242,1.783,6.952,3.481,0.307,3.481,0.433,6.905,2.344,3.771,5.123,6.514,0.544,0.731,2.195,9.193,4.844,3.799,1.903,8.898,0.103,8.832,2.072,4.275,5.032,0.81,2.661,0.32,5.963,6.555,1.653,0.146,0.685,8.594,0.446,0.164,2.04,1.409,1.377,2.414,3.301,3.267,1.988,3.818,1.157,0.202,2.604,5.705,1.133,7.088,5.348,1.309,0.837,2.311,4.309,3.435,6.966,6.088,0.093,4.725,4.9,1.545,2.837,0.553,7.393,7.626,0.128,8.357,0.36,0.311,1.385,6.953,4.911,2.131,2.23,4.755,0.552,2.898,4.473,6.249,2.481,1.967,0.366,1.852,3.256,4.754,8.342,0.236,5.653,1.149,0.677,0.309,2.045,0.112,4.124,2.99,5.035,0.335,5.213,2.447,0.2,7.407,4.075,0.772,9.003,6.33,0.931,5.492,0.272,1.712,3.779,1.643,0.089,0.808,6.364,1.916,1.13,9.345,0.64,3.873,1.731,0.72,3.542,0.702,6.47,5.358,3.246,0.572,4.214,0.77,9.189,1.37,2.007,0.024,3.509,4.77,4.146,3.544,0.069,1.226,0.762,0.785,1.781,0.494,9.351,0.286,3.365,5.746,4.699,0.083,0.457,7.558,7.583,0.381,0.68,1.503,5.773,0.571,3.08,1.359,0.404,5.698,7.722,6.728,3.84,5.306,0.428,0.661,4.718,0.471,2.08,0.333,3.192,0.884,4.544,0.381,1.794,3.086,7.058,6.834,0.306,3.351,7.639,0.388,3.605,8.226,1.472,0.19,0.735,5.858,6.44,6.077,9.316,0.755,5.277,9.246,0.786,3.074,9.187,0.114,0.151,1.354,2.085,9.531,8.717,0.725,1.141,0.455,1.405,0.867,6.269,1.111,1.107,5.111,0.988,4.895,6.49,0.658,0.4,1.009,1.566,0.641,5.996,8.348,4.782,4.149,7.278,3.943,1.238,0.732,9.275,0.717,7.409,4.277,1.622,6.106,8.114,3.439,3.445,0.195,0.339,0.306,3.945,5.225,2.322,1.461,3.122,6.802,4.218,0.373,1.4,2.542,3.713,0.907,8.897,3.437,0.134,1.293,5.901,6.188,2.654,2.778,2.281,8.253,6.899,4.749,0.347,0.697,0.327,6.496,2.259,1.466,0.517,2.245,3.198,4.99,3.975,0.58,0.543,8.927,3.447,3.183,0.387,1.071,2.422,5.32,0.526,0.22,3.276,6.163,2.525,0.624,0.252,2.687,6.842,2.666,0.81,9.179,8.007,6.315,1.044,6.107,1.457,2.457,2.734,3.551,5.604,0.828,1.273,0.808,3.181,1.151,6,9.093,3.287,6.114,4.602,0.808,0.388,1.889,4.568,0.165,0.198,7.406,1.382,5.329,1.001,3.184,1.427,1.688,0.217,8.587,9.372,5.339,1.716,0.088,3.927,1.017,4.301,0.396,2.11,0.542,1.201,0.62,1.234,2.976,0.116,8.771,0.521,8.185,1.913,0.096,1.781,2.257,3.507,4.164,7.032,1.326,7.788,1.46,3.171,4.51,1.201,0.19,1.95,3.394,2.202,1.246,1.053,0.619,0.983,5.525,5.134,1.022,7.1,3.286,0.834,0.207,6.505,6.574,6.639,5.376,8.602,1.526,9.163,5.027,6.405,4.733,8.624,0.726,3.039,7.148,7.396,1.404,4.869,2.047,0.685,0.099,4,0.074,8.335,1.803,6.104,4.042,0.611,2.344,0.742,0.218,7.988,5.597,0.11,8.414,0.53,3.42,5,4.593,0.177,0.559,2.369,2.542,1.31,3.367,0.159,4.064,0.495,2.651,2.703,0.273,1.045,6.922,0.636,0.744,0.388,1.859,5.283,4.904,1.467,3.891,1.177,0.247,3.448,7.853,7.91,0.903,1.257,2.662,0.785,0.193,6.826,3.62,1.603,8.479,0.262,4.199,0.691,7.572,1.527,2.224,2.306,6.017,7.448,1.675,3.5,4.56,8.208,8.13,7.944,0.217,0.905,4.125,0.593,7.617,0.115,5.574,1.834,2.179,4.892,0.836,4.504,0.332,6.768,6.226,6.901,2.743,0.13,3.108,3.586,2.381,6.897,2.738,0.248,0.684,6.208,5.243,8.668,0.498,4.949,0.269,4.672,5.997,0.64,3.518,1.14,6.585,0.944,0.82,1.919,7.316,7.314,1.151,3.52,1.378,3.707,6.692,5.872,5.708,2.495,5.1,6.572,0.358,2.383,1.84,0.916,3.167,8.087,3.361,5.789,1.15,1.129,4.712,5.721,6.653,6.215,3.175,0.383,0.527,0.247,7.194,7.485,1.047,3.188,5.384,1.121,3.011,4.14,7.283,0.728,6.847,6.608,2.375,0.22,5.949,4.098,2.132,1.01,8.51,1.074,0.152,4.075,8.595,0.33,4.481,0.237,6.462,2.458,5.399,7.283,5.048,3.466,0.717,2.786,7.642,6.928,1.42,4.793,2.285,0.211,2.303,5.829,4.784,1.615,1.274,3.638,1.818,7.789,0.317,0.559,1.035,3.404,0.907,3.879,1.848,1.265,3.588,0.077,1.501,2.331,1.529,3.698,3.348,9.131,0.496,1.736,5.753,4.038,5.542,0.509,0.392,2.196,0.493,6.765,8.249,5.907,0.701,1.076,9.05,1.435,1.266,9.707,0.372,2.816,6.461,0.566,9.605,6.226,4.666,0.311,2.145,2.893,8.76,7.66,2.81,0.682,4.15,6.454,4.552,1.068,5.967,2.844,5.056,3.13,2.483,2.175,0.452,4.773,1.753,0.502,1.336,0.519,1.048,0.433,0.844,0.469,5.501,0.993,1.302,1.919,7.629,6.835,1.699,1.887,5.892,5.599,0.393,3.19,2.289,2.379,2.544,4.191,1.282,7.772,2.273,4.053,3.119,3.625,1.248,0.707,5.724,1.79,7.54,0.402,0.271,0.195,4.132,2.997,4.479,4.348,1.686,1.064,0.393,0.768,1.323,0.838,0.127,0.939,0.368,1.501,1.493,0.498,4.897,0.992,0.226,4.346,0.296,0.593,7.736,0.722,1.033,7.343,1.29,0.754,8.374,8.061,6.638,4.63,0.113,2.454,0.757,9.152,1.044,0.663,0.397,0.318,3.752,0.268,0.344,9.011,0.386,0.237,4.813,6.161,6.321,2.828,7.689,1.447,1.713,6.432,0.174,0.472,2.34,0.266,0.098,4.262,8.554,1.503,5.755,3.459,0.097,0.166,1.695,1.734,3.219,3.685,1.071,0.244,0.947,5.387,7.199,3.878,0.332,8.621,0.933,0.634,6.583,7.724,9.018,0.848,9.395,0.164,8.315,6.944,0.981,1.691,8.778,0.395,3.614,0.076,7.283,1.337,0.352,0.477,2.981,4.313,0.195,0.511,3.69,2.064,1.149,3.389,1.618,4.736,6.051,6.538,1.536,5.716,9.618,1.02,8.195,0.704,4.273,2.68,0.332,2.48,0.321,2.608,0.393,0.173,4.336,1.349,0.698,3.169,1.807,1.485,3.55,0.214,0.682,1.923,6.511,0.565,1.718,4.867,8.51,4.96,0.464,3.389,3.122,1.131,3.094,1.672,0.225,0.458,0.917,7.086,2.57,6.487,0.634,1.8,4.989,1.536,8.503,0.389,1.227,2.94,2.692,1.08,0.803,0.352,5.006,0.616,3.75,0.127,4.009,0.62,1.332,8.439,2.894,0.211,4.689,8.021,0.183,5.026,7.513,7.759,3.35,6.386,1.111,8.858,4.253,6.937,3.228,0.234,4.473,3.491,0.094,2.294,9.692,7.676,2.293,0.46,1.57,3.333,7.004,2.317,7.937,0.852,3.77,2.088,0.322,2.512,4.206,0.181,7.744,3.741,0.095,5.47,2.483,4.505,6.183,0.225,1.289,4.976,1.054,5.319,3.172,1.486,9.571,4.375,4.979,0.571,0.597,5.451,3.748,3.43,6.753,5.351,2.535,1.002,0.35,2.439,4.926,0.46,0.232,1.688,4.921,3.796,7.803,6.574,4.692,1.976,2.751,5.326,8.061,2.251,1.528,0.781,2.396,8.102,5.396,4.138,7.681,1.879,0.298,3.694,8.538,2.344,0.441,3.299,3.759,1.879,2.449,1.695,8.132,8.464,5.036,3.254,5.431,0.281,0.661,6.535,3.242,7.956,3.921,5.73,2.232,2.677,2.296,0.329,3.918,1.32,6.99,1.995,6.662,9.287,6.071,0.596,0.436,1.12,3.244,0.175,5.929,1.755,2.04,0.52,0.084,6.834,0.323,0.388,6.386,8.956,2.405,5.323,2.98,3.725,0.501,2.835,7.78,7.004,0.621,1.316,2.092,3.195,5.298,1.944,6.342,0.858,7.328,1.928,1.027,4.184,2.073,1.305,8.252,3.958,3.197,6.557,2.616,0.126,4.865,4.432,4.225,0.221,3.571,3.751,2.737,0.115,7.302,7.156,1.096,0.884,5.722,6.704,1.713,0.27,6.009,3.773,0.35,9.484,3.272,6.142,9.493,0.333,0.175,2.328,4.084,0.935,5.124,5.646,7.005,3.136,5.58,4.691,1.464,1.42,0.448,0.455,5.362,0.38,1.024,4.205,1.881,6.203,5.41,7.814,3.649,7.756,0.646,0.214,3.29,5.566,0.154,6.402,0.503,0.975,1.168,2.591,0.236,1.771,5.337,0.233,0.503,0.558,9.088,0.151,1.172,0.736,0.923,3.366,0.413,7.14,1.804,4.07,3.552,8.403,0.801,2.412,3.05,0.25,0.574,0.125,0.726,0.317,3.448,0.454,7.649,4.016,5.579,2.061,9.65,3.315,2.303,2.111,5.164,1.845,7.615,0.724,1.466,4.33,0.37,0.954,0.247,3.555,0.596,2.922,6.07,5.805,1.365,0.85,0.464,0.517,9.13,0.817,0.505,2.678,2.214,0.347,8.888,0.177,0.779,0.317,1.494,0.258,2.237,5.931,0.876,3.33,2.142,0.507,7.184,2.454,3.054,0.727,0.259,2.597,9.375,0.662,0.538,3.365,3.24,2.113,0.253,1.79,1.436,8.632,2.536,8.388,1.539,6.751,3.678,1.596,7.137,4.028,4.477,0.813,0.438,2.719,3.23,0.263,0.466,3.761,2.467,1.347,2.84,0.996,2.099,5.336,3.319,0.344,0.567,5.256,0.157,0.122,0.734,5.621,9.084,2.29,6.191,1.178,0.652,2.125,3.044,1.487,1.886,0.593,1.234,8.374,4.425,1.832,3.658,1.436,5.835,7.116,4.159,3.619,1.262,7.857,2.524,2.028,6.568,2.046,0.831,7.492,5.659,1.707,4.725,4.463,3.787,7.462,0.145,2.947,0.901,6.022,1.118,6.507,3.257,6.546,0.872,1.208,4.679,2.213,1.615,5.989,5.988,3.98,8.195,3.134,2.179,3.819,4.716,1.062,1.224,6.07,4.014,7.361,3.747,4.017,0.404,1.751,0.208,5.194,0.244,1.441,6.72,2.401,2.34,4.141,0.831,1.402,0.315,1.263,6.395,0.456,0.473,5.58,5.583,0.577,2.693,0.512,0.587,0.595,0.923,1.157,1.895,1.343,0.349,2.597,3.933,0.422,2.914,4.703,0.606,1.543,0.453,4.828,0.626,1.222,3.091,1.987,0.627,4.862,9.771,0.598,4.413,0.422,0.532,1.797,1.765,3.049,1.676,1.119,8.712,1.426,6.167,6.461,1.279,0.372,2.558,2.298,1.113,1.152,0.131,2.809,8.249,2.181,1.679,4.793,4.242,7.051,1.343,8.289,6.435,5.142,0.922,0.461,2.024,3.658,2.115,0.119,0.157,1.957,1.124,7.124,2.368,3.223,3.337,6.892,8.589,3.716,0.445,3.82,0.394,7.081,0.277,1.697,6.559,5.28,4.895,1.102,6.796,9.137,1.206,4.921,0.144,5.863,2.93,6.213,0.258,1.062,0.079,2.22,2.017,5.443,0.11,1.645,0.736,0.3,5.751,0.944,1.214,5.018,4.978,6.57,7.667,7.281,8.281,1.608,6.587,8.73,2.234,4.7,8.839,6.699,0.103,4.726,2.568,0.91,1.278,5.606,5.378,1.103,2.091,0.713,0.857,4.855,1.593,3.817,0.367,2.976,1.619,9.559,3.587,5.726,2.326,7.711,5.458,0.403,0.923,2.906,3.234,1.312,7.113,6.817,3.467,0.959,0.936,4.665,2.604,7.803,0.556,3.501,2.627,0.448,4.242,2.271,1.602,1.201,0.622,4.251,3.876,4.489,1.03,1.387,2.914,0.984,0.064,7.301,5.295,8.781,8.874,0.587,3.517,1.687,4.71,2.43,4.651,9.946,9.159,0.309,0.681,0.206,0.219,6.085,4.204,0.677,1.253,6.05,8.199,6.26,1.24,5.722,7.458,6.493,1.851,4.492,0.468,1.362,1.938,0.344,1.376,0.258,1.793,0.068,0.648,2.547,6.041,2.999,0.439,8.755,0.556,5.863,9.045,1.169,5.37,2.606,3.35,0.206,1.157,2.22,0.259,3.65,1.839,3.934,5.925,8.703,1.372,8.471,1.511,1.364,2.736,2.341,2.103,8.891,2.711,4.99,5.246,4.841,0.394,1.062,6.735,2.458,0.33,0.494,0.675,1.586,0.671,9.195,0.926,5.874,0.22,9.356,0.245,1.391,3.117,0.088,9.118,0.916,3.031,0.946,8.902,8.803,0.83,5.892,2.05,7.629,9.568,4.09,8.448,9.347,0.518,6.327,1.215,0.346,2.388,2.655,0.693,1.478,5.72,4.959,4.617,5.318,8.722,0.568,7.244,2.464,1.727,1.445,0.246,2.187,4.033,0.405,4.458,1.594,0.272,4.661,1.726,6.137,6.787,0.258,0.392,1.459,2.861,0.925,0.401,7.816,0.828,3.521,3.166,0.744,7.417,4.522,1.654,0.271,2.379,5.16,1.958,5.667,1.162,4.254,0.487,6.121,6.161,2.016,3.549,1.963,5.925,3.8,2.085,0.476,7.246,8.127,1.444,7.108,0.504,4.934,5.385,8.312,1.292,0.634,2.114,4.63,3.201,7.159,3.763,2.833,0.736,7.811,2.146,7.742,5.323,5.305,0.16,6.334,0.189,1.09,3.907,5.687,1.788,1.58,1.975,6.805,2.922,3.613,0.124,8.817,4.084,1.315,9.116,1.255,3.517,0.831,6.62,1.069,0.716,8.822,4.563,7.008,2.625,2.374,0.606,0.236,1.908,0.468,2.602,4.616,2.856,1,4.687,8.758,0.438,3.234,3.274,1.012,5.456,0.136,5.07,3.863,2.731,5.106,3.38,2.27,1.715,1.11,0.24,0.932,9.434,3.649,0.589,0.664,0.59,1.762,1.769,4.077,1.752,1.802,5.472,0.311,4.895,2.831,2.418,5.667,9.446,1.663,0.959,3.165,4.09,5.309,4.994,1.235,8.918,5.71,1.715,0.949,5.114,4.791,2.038,0.488,7.566,1.883,3.061,4.666,2.377,2.395,5.992,4.92,4.638,1.518,2,1.792,4.917,2.729,1.374,1.904,0.735,5.417,6.822,4.678,5.8,7.177,5.467,0.582,5.678,3.081,9.738,1.44,4.373,0.571,2.289,3.116,1.269,5.045,2.501,6.382,0.815,0.657,1.235,5.199,1.762,0.174,1.213,2.505,4.148,6.585,3.276,1.901,4.664,3.483,8.333,3.076,2.7,4.164,4.311,2.812,2.275,3.396,8.887,0.83,7.084,2.57,5.526,2.302,9.158,8.8,2.025,8.17,0.639,5.922,0.468,0.488,5.242,2.622,0.128,1.969,2.637,0.795,0.942,4.004,4.252,6.866,4.735,9.471,3.683,0.48,5.282,4.627,1.79,0.275,4.381,1.601,9.549,1.191,0.894,0.324,6.035,1.695,2.582,0.151,2.451,1.835,5.183,4.087,9.046,6.722,4.8,0.749,0.202,4.938,4.58,5.394,3.417,4.157,0.75,7.129,6.667,0.26,6.417,2.157,0.71,7.046,6.646,0.339,3.674,6.457,1.453,2.874,8.326,3.763,5.722,0.334,2.234,4.757,9.344,0.335,4.449,8.438,7.499,1.291,1.521,2.482,0.283,2.955,2.819,1.258,1.005,4.939,5.15,1.37,7.188,8.01,0.41,6.516,5.929,0.3,8.652,2.509,0.286,1.773,0.523,4.094,0.913,3.812,5.884,4.347,5.67,6.02,1.448,4.942,7.204,0.233,0.771,4.234,1.299,0.726,1.186,4.936,7.149,0.234,0.37,1.555,0.964,1.474,6.645,0.828,2.183,2.13,0.165,0.092,5.244,9.754,0.575,2.298,0.508,3.609,4.746,0.636,0.605,0.912,3.38,4.3,0.126,3.15,0.539,4.342,0.275,1.57,3.837,1.253,0.388,1.178,6.875,6.154,1.22,1.491,2.561,2.938,0.41,0.431,3.931,0.239,2.253,5.534,1.048,0.796,4.244,0.078,4.099,2.045,3.286,4.699,3.317,0.526,1.474,2.063,5.941,2.219,5.994,6.884,0.75,3.795,0.293,0.536,0.178,9.618,1.319,5.571,0.233,7.475,5.147,3.727,6.062,1.027,0.137,1.794,1.946,0.47,0.489,0.643,7.945,4.238,4.063,9.282,6.499,4.01,0.951,7.518,1.452,3.703,2.786,2.059,1.889,0.839,1.919,6.774,0.681,0.996,1.045,2.471,3.078,2.792,4.583,1.483,0.51,2.629,1.916,5.412,0.315,0.124,6.945,6.091,3.18,7.684,6.723,0.958,1.445,5.303,3.569,2.908,5.599,1.543,1.699,3.217,0.796,0.628,5.491,5.333,6.759,0.415,0.213,2.515,0.187,4.439,2.308,3.799,6.924,3.471,1.478,3.813,0.266,3.687,4.07,0.243,0.401,2.772,1.793,0.153,1.867,0.864,4.462,7.614,6.283,5.59,2.495,3.765,1.192,0.875,0.878,0.909,4.98,2.497,7.883,7.755,7.717,6.288,6.044,1.592,5.389,5.095,1.234,0.756,5.113,1.785,7.412,7.347,0.75,2.636,0.772,5.355,0.222,5.147,2.587,7.051,0.348,1.359,1.111,1.132,2.092,0.787,0.445,0.793,1.357,2.85,1.083,0.522,2.97,1.175,6.239,0.053,5.145,4.566,0.267,1.817,4.752,7.466,8.72,2.408,0.261,2.722,8.97,0.317,1.217,5.335,8.738,1.669,5.687,2.114,0.308,0.619,0.827,3.452,0.561,0.341,6.667,3.195,7.01,7.793,7.183,1.648,3.234,0.78,3.413,3.923,2.575,1.345,3.279,2.211,0.24,1.362,3.158,5.093,4.227,0.274,4.313,1.417,4.557,2.425,0.759,0.309,1.023,0.587,0.186,0.271,1.019,2.203,6.315,2.631,5.611,1.349,0.633,0.247,0.851,5.213,2.647,3.748,2.801,0.187,3.675,2.764,0.506,0.472,0.669,5.624,0.272,2.822,0.859,1.742,1.983,5.183,3.023,4.517,3.042,5.809,1.794,1.869,5.808,7.295,2.59,2.156,0.454,8.144,2.721,7.256,0.337,2.693,1.544,1.857,5.432,8.86,7.022,4.896,1.575,2.376,6.471,5.136,3.025,1.112,6.555,5.165,2.358,7.174,7.563,2.344,4.988,5.294,1.758,1.123,7.201,0.694,7.412,6.476,0.905,4.43,2.827,4.106,0.795,9.447,8.706,2.044,2.555,0.704,1.356,0.589,0.815,1.822,9.485,1.981,1.913,0.685,8.116,5.369,8.12,2.98,6.119,9.215,5.488,1.875,0.344,6.335,3.416,0.194,3.167,0.282,4.244,2.241,8.292,2.342,0.666,0.358,1.045,4.706,5.039,0.241,2.801,4.586,6.478,0.53,0.985,3.099,3.412,6.444,2.736,7.923,3.496,2.514,1.799,2.92,3.336,0.25,6.861,1.888,9.294,4.213,1.148,1.011,6.101,0.095,1.633,3.273,2.951,9.646,1.495,0.206,1.546,1.75,1.065,1.247,4.385,2.299,0.441,7.489,2.22,2.468,0.235,0.373,8.376,2.039,2.224,3.946,7.503,4.601,4.137,0.915,1.095,1.484,0.549,7.293,1.305,1.088,2.524,5.578,3.642,0.515,0.832,0.246,5.839,2.192,5.009,7.225,5.189,0.489,5.038,0.719,4.483,1.292,4.307,6.98,8.647,0.282,0.836,0.158,0.285,1.602,6.109,1.047,0.936,0.74,4.385,1.159,5.343,8.615,7.684,1.747,0.4,2.802,4.19,6.496,0.951,0.958,1.312,7.258,0.386,0.217,3.123,1.952,2.462,2.468,2.263,1.331,0.169,1.653,2.002,4.576,1.107,1.734,5.491,8.673,2.805,2.467,2.515,3.413,0.172,2.84,6.936,8.986,1.813,0.243,9.501,0.796,2.463,1.479,8.389,0.572,1.761,2.019,0.633,8.647,0.159,0.126,0.422,2.934,0.102,2.185,1.704,3.109,0.771,3.469,2.599,1.823,9.119,1.902,1.243,0.557,0.35,5.49,0.316,2.373,5.574,2.564,0.775,0.964,2.695,5.13,4.74,2.26,1.302,8.8,2.445,0.344,3.487,0.07,0.087,0.784,0.999,0.855,3.788,5.72,1.84,0.882,2.623,1.037,4.363,6.373,5.168,6.593,7.512,0.827,0.484,0.231,1.733,1.444,0.473,0.597,0.576,9.085,1.339,1.086,2.007,4.038,3.849,2.171,0.84,1.185,9.021,0.118,0.779,8.613,0.487,0.723,7.799,1.263,1.286,0.038,1.317,6.498,2.753,0.947,1.259,0.955,6.766,2.484,1.037,5.387,3.17,2.101,3.7,1.601,0.184,2.887,1.506,0.26,0.836,1.832,3.432,7.551,4.784,1.369,9.388,8.663,8.954,6.088,4.998,9.298,3.908,7.184,0.632,2.073,3.856,0.727,0.298,1.63,1.951,5.849,0.73,4.732,0.168,0.219,2.744,4.059,1.92,0.206,2.966,2.297,7.134,6.131,3.084,1.273,2.06,8.864,2.285,1.746,0.084,5.957,0.614,1.508,4.508,4.607,1.274,2.475,2.546,3.98,0.806,2.929,9.357,3.387,5.481,0.844,0.465,5.342,2.868,4.891,1.838,5.547,1.325,0.591,1.118,3.352,2.846,0.663,1.311,1.016,1.774,1.331,1.646,7.946,8.839,0.954,2.206,0.645,8.971,8.94,1.882,0.334,8.645,0.822,0.92,5.938,1.842,0.976,0.769,4.805,0.542,1.481,5.09,1.899,1.964,0.162,3.592,1.952,0.253,6.578,1.336,0.147,5.486,5.742,9.779,2.934,4.955,3.674,4.414,4.962,7.967,4.412,4.128,1.097,1.141,0.45,4.029,1.429,3.237,5.231,2.42,4.036,6.247,3.911,0.963,2.57,0.462,3.539,3.529,0.769,3.317,1.988,5.005,1.224,3.771,3.356,4.562,2.173,0.099,6.245,6.749,1.983,1.973,2.873,1.372,6.447,2.794,8.354,1.006,2.12,0.552,6.289,1.549,0.209,1.196,2.155,5.261,1.043,0.91,4.453,0.355,1.703,6.003,3.827,2.91,1.248,7.247,3.144,4.505,0.615,5.195,1.758,1.811,7.927,3.481,2.67,0.674,9.205,0.306,7.653,0.652,5.74,1.489,1.163,2.467,1.116,0.569,0.846,0.578,1.671,6.769,0.173,4.865,1.046,1.878,0.258,7.233,5.73,5.86,7.042,0.334,0.101,0.128,1.192,4.66,1.768,3.948,0.198,0.245,1.35,2.159,0.184,4.653,1.122,0.143,5.428,8.185,5.281,6.041,2.981,1.079,2.039,0.249,1.585,3.817,0.74,1.892,8.657,1.69,6.71,3.397,1.974,4.204,1.05,0.271,5.285,0.31,2.696,6.005,9.336,0.394,0.209,2.595,1.356,4.889,0.43,5.68,7.875,6.976,0.151,7.221,6.732,3.9,1.299,6.675,0.496,7.15,0.823,2.943,5.843,0.368,0.642,0.329,4.542,1.298,7.639,8.282,0.124,0.744,5.554,1.524,4.12,1.127,2.53,0.42,0.748,0.343,1.111,8.465,0.195,5.571,0.47,0.304,1.649,1.415,1.465,2.08,5.475,0.853,3.977,1.404,4.724,0.24,9.294,0.367,3.457,1.626,1.61,2.434,1.3,2.619,0.192,0.858,1.02,3.317,7.206,3.165,6.485,3.772,6.444,1.228,9.599,7.514,0.216,0.398,0.989,2.107,0.187,5.255,0.601,2.11,0.269,5.182,1.662,3.631,0.318,9.592,0.621,6.188,0.107,4.478,6.251,0.263,0.359,6.487,0.801,0.527,1.332,2.563,0.715,6.323,0.876,0.228,7.755,5.464,4.88,0.787,2.829,0.826,0.532,9.425,0.419,0.103,5.06,4.832,0.465,2.956,1.268,3.125,0.484,1.294,3.72,4.204,1.773,3.937,2.942,5.656,0.449,2.878,9.019,6.168,3.231,0.089,7.285,4.766,0.231,0.639,4.747,1.989,3.581,0.651,8.304,5.399,2.114,1.542,7.361,4.523,5.146,4.63,2.895,1.03,0.521,1.997,4.584,1.633,7.878,0.192,6.307,3.678,0.613,1.483,1.283,0.297,0.125,7.645,0.216,2.741,2.028,0.902,7.669,1.223,0.951,0.432,0.653,1.742,2.039,1.307,3.187,5.965,3.987,6.278,3.192,0.883,2.924,5.578,8.4,8.813,1.354,1.189,0.543,1.434,2.671,3.539,1.198,5.298,3.987,2.478,1.19,2.711,1.542,6.865,5.425,0.194,0.966,4.916,2.801,0.162,0.227,2.944,8.989,1.04,0.957,0.122,1.879,4.366,0.454,2.107,2.386,1.752,2.384,0.49,3.512,0.191,7.308,1.647,1.014,2.193,0.037,0.846,4.92,2.758,1.149,3.597,1.713,2.326,0.595,6.186,3.989,2.853,0.681,0.514,0.803,6.226,1.589,0.187,7.196,3.502,5.156,6.95,9.179,0.171,0.511,4.988,2.536,1.781,1.827,7.05,0.235,7.812,3.968,5.972,6.86,1.018,1.466,8.396,3.84,7.755,0.451,4.861,3.31,1.742,2.062,0.88,0.587,0.446,8.664,2.474,3.211,1.544,2.05,3.528,3.041,5.305,3.088,0.735,9.558,3.441,2.299,1.829,7.093,2.097,4.593,6.307,0.383,0.873,0.118,2.759,8.377,9.106,0.088,3.334,9.762,5.159,2.482,7.663,1.128,0.549,3.566,0.278,0.246,0.379,4.99,5.538,3.814,2.412,1.811,3.701,0.095,3.24,2.777,2.544,2.721,1.731,0.229,8.551,4.039,1.591,4.228,1.696,1.562,0.55,3.965,5.69,0.66,0.899,3.755,3.519,7.252,2.514,2.06,7.278,4.437,2.349,0.726,7.58,3.921,0.632,3.653,7.052,6.34,0.801,1.018,8.235,4.16,3.7,2.414,3.66,0.339,0.346,6.707,6.936,2.329,2.057,4.249,1.772,5.186,5.879,0.847,3.189,0.322,7.14,3.959,5.269,7.077,2.548,0.596,2.55,5.282,7.056,2.761,3.584,3.954,8.195,1.161,1.11,0.5,4.898,9.65,0.356,8.198,0.621,7.481,0.688,0.474,3.089,8,3.191,2.492,4.431,5.708,0.615,0.953,3.986,4.591,8.84,8.785,1.814,0.715,7.912,2.28,1.937,7.323,1.433,1.631,4.201,1.123,4.413,0.189,6.796,2.925,3.012,0.543,5.482,5.241,4.314,5.571,5.105,0.264,8.38,0.442,7.08,2.788,1.863,0.385,0.356,3.594,2.409,7.609,3.725,0.676,5.708,0.316,1.067,1.261,0.834,4.792,3.034,1.405,3.465,1.254,5.638,0.257,1.381,4.278,0.155,0.479,2.631,8.951,2.917,1.812,2.17,0.313,5.218,7.564,5.12,4.356,3.918,1.418,1.518,3.198,0.901,7.842,0.344,7.378,5.87,3.415,0.753,4.354,2.516,2.195,1.152,2.911,0.112,5.789,0.553,4.41,4.293,2.108,0.186,3.288,8.63,0.286,1.932,2.557,0.203,0.102,5.391,0.517,4.051,5.201,3.802,5.315,3.427,2.883,0.264,6.094,0.902,5.57,0.179,5.348,8.282,0.245,1.325,3.506,7.436,0.09,0.254,1.276,1.22,3.217,3.97,6.409,3.619,4.748,1.856,3.467,0.197,2.509,6.279,4.167,6.298,3.536,7.73,1.313,9.698,5.103,4.921,5.302,1.695,6.232,2.227,5.817,0.427,2.702,5.712,4.262,0.363,2.028,1.681,3.206,0.781,1.452,8.289,1.03,5.688,7.114,0.279,1.156,0.909,0.955,1.741,4.353,7.207,0.745,5.49,0.781,6.326,2.055,1.284,1.897,9.188,0.738,1.176,0.282,7.621,4.957,1.862,3.682,0.499,0.811,4.495,8.432,2.843,2.101,2.111,1.573,4.217,0.68,1.314,2.891,1.841,8.723,0.831,2.937,3.267,2.118,1.738,3.188,1.551,2.724,7.365,1.069,0.344,4.415,2.429,3.792,3.832,2.083,0.215,0.209,2.404,2.713,0.741,8.199,1.033,4.441,6.157,0.966,1.351,4.987,1.258,2.052,8.952,4.044,5.952,0.285,1.134,4.273,1.736,1.341,0.543,0.45,2.842,6.182,0.565,8.405,1.234,5.989,4.556,1.23,7.385,1.046,9.309,0.393,8.458,4.613,8.574,0.557,0.039,2.488,4.999,2.791,8.373,0.287,1.693,8.316,0.232,2.654,9.801,2.8,3.989,3.829,0.092,5.213,0.724,1.921,9.276,6.259,3.065,0.308,0.655,0.411,6.329,9.511,6.342,6.902,3.19,1.687,5.729,0.401,0.82,4.255,2.391,5.758,1.295,8.681,1.812,1.084,0.789,8.853,0.338,2.373,5.584,8.237,0.2,4.192,5.047,2.658,3.123,2.227,0.821,3.157,4.896,3.989,0.858,5.583,1.454,5.831,8.329,6.283,3.476,7.659,2.93,2.947,0.146,1.123,1.776,1.607,0.52,0.848,6.853,1.047,2.529,1.665,0.534,0.758,5.916,8.624,0.413,0.776,1.122,6.388,0.896,7.409,3.978,1.711,4.854,2.443,8.565,0.215,0.259,1.514,5.678,1.118,1.475,4.193,3.132,2.135,5.596,8.669,5.299,0.81,1.171,2.596,3.176,3.986,2.01,2.303,1.795,7.292,4.522,0.431,0.349,0.515,0.257,1.965,1.001,3.831,4.081,0.905,7.69,4.563,3.891,1.661,6.566,6.384,1.071,3.934,1.906,2.913,1.514,3.604,2.631,0.224,0.862,0.938,3.803,2.582,1.178,6.642,1.128,4.835,1.757,1.667,1.368,1.743,0.886,5.373,5.605,1.89,0.465,3.734,1.087,0.859,1.166,4.287,2.754,0.622,0.501,0.502,9.432,6.851,7.042,1.366,8.601,0.794,0.384,5.733,3.296,2.008,2.639,5.863,2.126,0.458,9.575,4.823,7.881,7.413,4.595,3.243,1.491,7.059,2.084,0.123,1.949,2.294,0.47,6.88,1.774,1.344,6.282,3.565,0.984,5.861,1.278,1.127,8.384,7.926,8.388,0.566,0.13,0.14,8.922,0.5,8.609,6.16,1.972,1.223,4.989,6.349,0.745,3.007,0.476,3.038,3.936,0.134,1.564,5.059,0.153,5.011,9.653,4.393,1.688,2.859,7.853,1.097,1.244,8.459,2.081,0.731,8.815,1.152,1.955,7.528,2.229,0.25,7.433,3.512,3.166,2.543,0.266,2.569,2.752,4.863,0.172,0.161,0.639,1.292,2.883,4.435,5.273,0.578,6.279,2.879,0.152,4.178,3.954,5.633,6.924,0.503,6.061,4.612,4.56,2.544,0.244,1.322,8.198,5.557,0.378,0.911,6.809,3.142,6.052,8.735,7.89,6.242,3.796,2.007,0.377,6.344,0.946,5.239,4.944,0.646,2.052,9.456,5.437,6.842,0.801,1.959,8.281,0.278,0.522,1.914,0.209,1.763,0.277,4.394,0.471,6.374,8.648,1.692,0.212,3.169,3.516,1.83,2.904,2.876,0.481,0.791,0.25,0.359,6.468,2.555,8.961,2.422,2.38,3.475,1.399,0.837,2.268,0.638,6.362,0.636,5.184,6.252,6.165,2.815,1.059,5.019,2.414,1.315,2.012,1.536,7.94,8.046,5.231,4.892,0.924,6.686,4.633,8.5,2.234,0.078,7.563,3.695,4.652,4.999,2.854,1.648,0.541,3.736,6.08,3.448,3.289,1.452,8.183,3.476,2.517,5.948,8.588,1.024,2.348,4.693,6.162,7.212,1.817,2.302,9.164,3.768,9.113,5.734,4.649,4.807,9.376,4.003,2.09,0.961,5.184,0.143,2.31,0.609,0.993,6.425,1.236,6.883,3.495,0.994,8.382,5.841,0.555,3.698,4.108,7.749,0.613,0.324,2.878,1.055,4.313,4.524,8.853,0.765,6.731,5.092,0.989,2.913,7.353,7.549,8.438,1.847,3.323,0.259,1.825,2.006,0.311,5.122,2.192,1.783,0.47,3.452,3.838,0.465,2.979,3.774,4.356,7.092,0.458,0.193,6.346,6.084,3.156,3.296,0.141,0.431,1.379,2.112,6.368,0.243,1.16,7.01,8.65,8.813,5.639,0.994,9.164,4.606,0.355,0.306,2.364,0.315,3.178,7.447,5.541,5.268,1.267,7.916,0.235,4.589,3.689,3.854,0.637,0.175,7.189,1.973,1.482,2.851,4.695,9.121,0.078,0.576,2.676,0.37,8.718,0.411,0.322,1.933,2.327,1.423,9.54,2.436,2.954,3.556,8.556,1.776,9.508,9.742,9.648,6.819,0.474,2.089,0.7,0.438,1.602,3.11,3.826,1.809,1.027,6.459,0.929,1.197,9.316,6.114,0.964,3.981,8.097,3.248,0.302,5.615,2.668,5.464,0.321,5.683,4.619,2.37,2.326,4.319,2.013,0.455,3.551,1.85,8.24,3.686,0.665,1.006,3.574,3.356,0.282,8.104,2.069,2.425,3.518,7.118,0.173,1.045,4.09,0.204,0.145,1.016,0.103,2.441,4.416,3.745,4.251,3.351,0.145,0.664,6.875,1.112,5.7,3.447,1.849,5.29,0.215,1.652,5.761,0.854,6.057,2.601,0.831,7.934,9.72,1.109,0.309,6.656,1.37,4.763,4.896,2.81,0.418,0.409,0.861,0.247,1.735,0.253,9.237,3.916,3.626,0.581,2.218,5.486,2.166,2.014,7.207,1.153,0.984,0.251,4.062,0.684,0.067,1.179,7.222,2.464,3.259,9.276,0.628,8.677,1.658,0.135,1.308,0.833,5.147,2.589,0.902,0.145,5.71,0.717,2.07,4.945,1.523,1.676,8.324,5.33,6.412,0.538,1.163,0.552,3.099,1.11,3.879,0.231,8.381,2.844,0.29,1.651,5.083,3.722,7.09,9.915,2.06,5.116,3.286,1.775,6.709,4.075,2.202,6.008,0.179,7.419,2.631,6.546,0.973,5.011,5.83,0.61,8.984,7.223,6.452,5.292,7.43,4.356,0.364,9.087,0.277,5.299,1.814,1.213,3.09,9.166,1.218,7.245,3.843,3.065,1.513,3.702,3.048,3.7,4.086,9.518,0.33,0.729,3.271,1.79,0.565,2.993,7.11,0.75,6.941,0.313,2.309,3.184,3.003,0.572,4.078,1.571,2.864,2.518,0.803,0.609,0.144,0.177,0.373,5.503,5.879,1.271,9.348,4.383,5.596,4.873,1.047,3.359,0.118,1.835,0.083,8.419,0.206,3.788,4.286,0.471,3.975,5.293,4.785,5.546,0.208,1.927,3.754,6.869,0.336,9.701,1.336,0.812,1.31,0.267,8.305,3.275,0.34,3.001,2.891,7.696,7.592,2.3,6.427,0.158,6.787,3.56,2.681,0.847,3.094,6.418,3.901,8.758,7.504,3.576,4.044,2.65,7.567,3.416,0.109,0.804,2.35,5.753,0.264,0.167,3.805,1.635,4.376,0.225,3.694,9.089,2.861,1.556,8.763,2.67,3.985,4.326,4.381,0.96,6.166,1.23,2.326,2.468,6.227,0.359,1.94,1.038,8.22,5.657,3.093,0.12,0.957,0.32,7.965,4.968,1.347,0.642,6.295,2.82,4.99,5.719,6.177,2.738,4.347,1.395,3.883,0.668,0.75,9.727,5.404,6.405,0.837,8.971,8.519,9.663,6.628,3.246,4.078,0.274,1.116,3.27,2.325,1.503,0.599,3.054,6.25,7.543,8.716,2.668,1.691,8.147,8.056,3.719,4.55,8.419,1.021,5.359,0.18,3.37,5.765,2.9,5.811,0.252,4.688,3.054,0.11,2.425,7.217,0.79,0.713,1.345,0.39,5.057,0.683,1.452,0.773,2.398,3.773,0.268,4.086,6.576,1.502,1.892,0.892,3.51,6.957,3.347,6.967,6.759,4.174,5.333,3.569,7.023,3.71,6.039,0.298,2.654,2.142,0.216,2.92,0.627,3.424,2.408,0.146,2.513,4.836,0.134,4.479,1.903,7.973,9.354,3.448,0.818,8.508,3.722,0.546,1.171,8.483,8.669,0.667,6.169,1.059,2.129,7.592,7.232,0.674,1.896,0.303,1.836,2.936,0.25,1.426,0.177,4.246,9.168,0.427,5.908,0.156,5.115,2.616,0.321,0.82,0.399,0.976,4.095,0.393,5.043,8.406,0.203,1.078,0.554,0.306,0.85,8.937,1.674,5.429,2.754,0.303,0.264,4.131,4.537,0.356,0.191,3.167,9.214,2.216,7.483,5.078,5.102,5.77,6.727,1.991,0.096,2.764,2.614,2.239,2.654,8.429,1.404,3.002,1.942,7.331,6.059,1.102,2.507,0.55,0.394,3.662,3.971,0.609,2.64,2.348,2.016,4.72,2.403,2.839,3.588,6.405,0.621,2.308,2.705,1.181,5.98,5.459,3.728,8.579,1.862,8.251,2.767,1.713,7.124,3.716,3.266,3.435,2,1.895,0.17,0.539,2.886,0.302,1.963,2.403,6.589,0.701,5.711,2.293,0.953,4.305,2.059,5.987,8.343,0.126,0.23,4.439,0.282,0.173,6.017,0.711,4.263,7.844,6.62,9.346,2.696,8.622,0.528,3.997,1.893,0.562,6.377,7.703,2.589,6.255,6.076,0.233,0.661,0.78,4.057,0.714,0.373,2.995,0.681,2.11,9.006,1.488,2.277,0.533,2.952,8.426,8.441,5.319,2.759,4.638,1.447,2.486,1.966,0.237,8.495,9.47,0.389,1.641,2.216,0.166,7.837,1.011,1.409,6.94,1.937,0.772,0.473,4.499,5.456,4.376,2.662,8.594,3.518,0.557,1.121,3.615,7.074,0.963,1.693,6.086,5.738,4,4.095,3.294,0.706,0.599,0.124,1.894,7.464,2.893,8.383,6.677,0.637,8.121,0.567,0.149,2.554,0.692,2.402,0.939,8.743,1.891,1.587,6.324,6.047,0.717,7.36,5.819,6.256,3.669,0.135,0.443,3.23,2.013,7.309,0.847,0.46,9.547,8.151,3.463,0.442,2.665,5.378,0.187,7.744,5.431,8.965,2.32,2.446,0.518,0.465,5.419,0.623,1.253,7.541,2.299,7.653,7.96,0.23,5.919,5.915,4.051,1.597,0.346,5.301,1.584,0.263,4.816,6.094,1.022,3.269,1.175,1.262,2.144,0.097,1.02,4.577,9.069,2.244,7.674,8.335,1.046,4.527,0.056,0.813,0.181,2.838,4.426,1.69,3.742,0.194,0.19,0.54,7.893,0.254,3.625,8.734,0.628,3.657,4.703,3.025,0.587,1.018,5.655,0.115,2.383,4.242,3.96,5.469,0.484,1.325,3.919,0.448,2.201,5.359,2.606,5.858,1.324,3.932,5.093,2.91,5.864,3.788,4.7,2.146,0.429,5.437,7.2,0.718,1.605,1.433,2.189,0.499,2.094,0.161,4.409,0.372,1.974,0.872,0.222,7.396,8.154,7.699,5.921,3.466,0.295,5.244,0.829,1.63,3.842,5.701,0.656,3.951,0.96,4.376,1.466,5.457,2.913,7.478,1.679,6.215,8.891,0.278,1.84,1.034,4.047,1.563,2.601,7.356,1.001,1.11,0.6,3.715,5.734,2.461,3.028,0.147,2.162,4.58,0.753,7.559,8.406,0.241,8.364,3.974,5.623,0.804,1.999,3.303,0.842,7.874,0.715,6.46,0.082,3.083,0.386,1.231,0.04,4.47,1.251,2.86,5.239,0.559,3.867,7.927,0.387,1.69,4.263,1.621,9.004,3.119,2.458,0.246,2.415,1.902,0.336,0.403,1.482,0.132,6.682,7.097,5.401,1.53,1.693,2.626,1.699,3.94,3.193,3.445,3.051,6.636,0.63,9.847,0.751,6.138,8.523,9.617,1.949,0.635,8.957,2.825,3.834,1.976,4.074,0.095,0.677,3.296,3.309,7.439,2.618,0.149,0.605,0.437,5.12,2.681,4.418,0.129,5.616,2.347,0.704,4.961,2.48,0.998,0.166,0.485,5.322,4.522,2.858,8.693,2.704,2.924,0.228,3.267,1.201,2.32,8.624,6.023,1.618,4.405,1.625,1.98,2.167,4.05,0.123,1.474,0.82,7.525,9.932,1.331,0.884,0.451,0.244,0.681,1.708,0.552,0.541,8.24,6.62,2.382,2.979,5.518,1.028,1.221,0.942,2.787,9.605,1.242,0.366,2.338,1.005,7.626,0.114,2.071,0.286,1.107,0.078,5.878,1.255,2.759,3.898,0.463,4.707,0.845,6.821,0.116,5.809,0.443,1.196,0.312,2.653,0.231,7.764,2.863,1.196,5.352,8.86,4.866,6.777,1.851,2.05,0.412,2.487,0.845,7.24,1.83,5.615,1.016,1.777,0.119,0.696,2.235,6.405,9.054,2.56,0.22,3.923,2.351,6.315,6.354,1.562,0.61,6.537,2.135,1.226,7.467,0.763,2.628,1.966,6.856,4.048,1.739,3.475,8.941,1.149,0.543,6.36,2.394,5.625,0.258,0.709,4.205,4.646,2.608,4.312,1.606,2.405,0.39,5.374,5.512,6.111,0.779,2.203,2.825,3.826,1.857,5.156,0.193,0.306,1.625,0.089,6.535,4.566,1.401,6.241,8.871,0.192,6.175,1.332,0.321,1.804,7.969,3.259,2.635,6.69,2.714,5.865,4.904,2.268,1.586,4.105,9.047,0.541,0.118,7.702,9.717,0.073,1.674,5.422,0.609,0.489,2.738,0.477,7.123,1.542,7.455,6.465,0.686,3.774,0.964,5.428,4.099,2.299,6.773,1.135,1.617,0.338,1.337,6.339,1.862,1.64,1.981,0.574,6.034,2.992,0.642,0.382,0.142,0.444,3.384,7.344,8.342,5.723,0.51,6.227,1.311,1.853,9.598,0.59,5.44,6.7,4.995,0.607,6.478,3.352,3.956,6.822,2.716,1.219,9.703,1.6,0.185,0.215,1.564,3.153,0.336,0.422,0.021,1.271,7.708,1.142,1.592,3.616,2.323,0.236,6.008,4.049,0.14,1.87,2.745,0.874,0.793,2.913,3.208,5.129,1.579,2.807,0.479,0.569,6.545,7.966,2.831,0.99,0.168,1.863,5.77,4.723,1.79,2.578,1.743,0.475,2.728,9.182,3.502,0.517,0.341,2.415,0.595,3.196,7.451,2.609,9.713,0.317,1.731,6.777,6.946,8.753,0.185,2.613,0.756,6.996,0.107,0.202,2.515,2.313,7.162,6.383,0.132,2.211,3.087,9.244,5.401,3.581,4.342,3.282,4.271,0.217,4.254,0.998,1.268,4.723,5.454,0.204,1.727,1.107,2.186,6.226,1.298,2.718,2.652,5.11,6.875,5.368,5.194,0.259,0.551,6.394,7.973,1.337,1.337,3.672,8.448,3.457,0.187,0.94,1.618,2.112,0.278,3.553,0.954,8.821,3.124,8.93,8.208,0.192,4.482,6.211,6.126,5.708,8.805,8.914,1.242,1.096,0.047,1.688,1.136,4.351,2.699,0.736,0.996,8.304,1.863,0.326,9.55,2.607,1.376,8.09,6.268,0.368,2.001,2.193,2.358,3.129,0.201,0.918,1.944,3.592,2.751,8.988,0.792,0.556,1.278,5,2.187,8.707,6.336,8.914,2.35,5.84,0.242,0.327,1.388,8.664,5.363,2.528,1.481,1.688,3.961,0.756,0.552,1.535,6.084,0.349,6.28,0.761,0.567,0.257,2.709,8.127,0.187,2.826,2.61,1.622,3.602,0.773,8.4,7.066,1.43,1.427,4.249,1.367,1.373,7.591,1.545,9.431,2.855,8.148,6.742,2.652,0.314,2.151,1.451,0.674,2.552,4.566,2.597,0.264,0.261,0.074,3.866,2.276,1.38,5.47,7.868,5.865,4.949,0.438,3.294,0.607,1.2,8.641,2.974,5.698,1.858,6.418,2.427,0.413,3.879,6.862,1.943,4.195,1.078,1.371,1.158,6.391,3.358,1.895,0.261,0.451,0.142,3.907,8.19,0.202,0.543,1.032,5.502,1.176,8.184,1.834,7.664,0.816,3.811,6.674,2.943,0.628,2.998,0.159,3.952,8.455,4.057,5.06,7.171,1.415,1.423,1.779,4.696,0.423,4.583,0.125,2.955,0.579,1.131,0.439,0.682,0.692,1.841,8.148,2.064,0.131,0.096,6.361,0.532,6.785,4.222,0.489,0.836,5.606,0.663,4.677,6.038,7.683,1.537,0.421,1.685,1.962,3.261,1.331,6.233,3.317,0.366,0.554,2.26,0.854,1.046,3.904,3.923,4.684,4.57,7.703,3.667,1.179,0.679,0.311,1.091,4.362,0.755,6.367,3.634,0.847,0.857,2.624,7.995,0.632,7.717,0.28,5.98,9.052,0.074,0.15,0.895,0.516,6.748,3.403,0.531,0.211,1.74,6.008,4.366,0.69,1.442,3.401,9.467,4.424,1.271,0.656,4.213,8.872,1.485,1.291,2.502,1.982,2.109,0.406,2.361,7.068,1.184,0.129,5.319,4.279,0.374,0.818,1.732,5.229,5.764,5.576,2.115,9.002,1.031,7.657,2.767,1.724,7.798,1,0.665,4.605,6.238,1.521,7.934,3.006,0.326,1.478,7.576,0.941,3.421,0.488,8.783,0.976,1.324,7.218,6.758,1.403,4.2,0.309,4.379,3.243,8.346,1.819,3.941,4.719,2.681,6.808,0.362,3.162,8.776,1.215,7.631,1.923,2.675,2.188,9.352,0.379,0.871,1.178,1.071,5.641,4.145,6.345,1.008,5.436,0.37,4.079,0.839,4.728,4.917,0.308,5.233,0.983,8.502,0.303,1.441,2.649,1.879,4.821,1.018,0.85,6.097,1.791,1.161,1.945,1.851,3.341,0.402,4.262,8.922,1.55,7.887,3.858,2.544,6.154,0.778,0.397,0.89,1.153,5.514,0.987,5.96,2.193,0.363,0.563,8.079,3.614,5.303,5.747,0.285,0.469,1.543,0.329,5.929,0.39,1.178,3.244,1.024,4.094,8.436,6.262,1.169,7.257,9.794,6.678,1.359,9.045,8.355,3.884,4.39,6.831,3.136,6.025,3.643,2.783,3.82,8.896,0.296,1.363,5.576,5.18,7.084,4.04,5.006,6.262,1.891,3.619,0.536,3.315,2.504,6.759,1.686,5.762,4.68,0.405,1.436,4.186,7.527,2.37,0.34,2.647,0.164,5.934,4.428,7.066,5.984,0.181,3.257,2.241,5.575,0.165,1.252,0.394,0.512,2.758,1.041,9.208,3.565,0.12,2.178,2.09,0.371,0.365,2.658,3.794,4.214,3.507,2.03,0.948,2.419,6.406,1.163,4.248,1.667,1.37,4.331,4.649,1.017,8.123,6.587,7.255,3.911,0.828,4.075,7.131,0.455,0.335,5.13,0.931,7.336,1.838,3.131,0.578,0.897,6.08,0.367,5.405,0.701,0.952,0.167,0.466,1.563,1.308,2.283,1.957,0.329,5.11,1.35,4.983,5.455,3.992,2.527,3.983,0.937,0.423,8.167,4.174,0.937,0.086,0.223,3.569,7.397,3.249,4.559,0.538,0.113,0.444,1.321,1.095,3.609,1.963,2.927,4.942,2.397,2.54,1.368,5.588,2.274,3.664,0.763,1.019,5.141,1.071,2.907,6.508,4.259,7.423,3.061,5.531,2.119,2.203,6.1,7.313,5.514,2.283,0.67,1.77,2.558,6.201,5.066,0.133,3.735,0.253,4.997,1.359,1.704,7.509,6.556,5.114,0.598,5.858,0.245,1.044,3.396,0.97,2.784,2.41,8.699,6.568,3.862,0.937,3.54,4.866,2.105,2.474,9.463,0.795,1.409,2.73,4.418,8.343,9.298,2.173,0.356,0.955,5.371,2.894,1.83,2.521,0.534,1.15,0.255,0.148,0.669,7.082,1.284,0.159,6.923,2.542,1.218,0.39,2.227,3.261,0.217,0.194,7.936,0.153,7.095,0.134,1.918,3.485,0.664,1.214,4.315,3.284,2.513,5.076,0.789,5.334,0.77,1.897,2.976,2.415,8.394,4.063,0.928,3.902,7.306,1.481,4.8,1.709,0.254,0.479,2.8,0.623,8.388,8.24,1.362,7.3,4.106,0.732,0.098,2.233,4.366,0.925,2,5.641,8.773,8.094,1.596,2.036,0.901,4.963,0.533,3.806,3.092,3.276,1.157,2.669,6.168,5.882,0.74,0.232,1.832,1.409,1.387,7.633,2.749,5.89,8.44,2.542,1.956,2.489,0.238,5.73,1.177,6.799,1.044,3.217,1.661,0.438,0.156,2.655,3.475,0.577,2.569,0.65,2.7,5.22,8.177,4.157,0.774,5.662,0.968,0.219,5.079,1.242,1.666,0.268,0.059,2.017,2.091,9.597,2.487,3.786,5.207,1,0.416,6.387,3.572,5.913,8.266,4.272,0.542,0.614,4.429,1.536,2.696,0.825,1.408,2.528,7.481,9.227,0.29,1.528,0.34,2.073,1.568,5.425,1.81,0.142,4.093,4.306,1.188,2.519,5.975,0.872,3.238,0.669,3.755,4.562,9.546,0.913,0.494,1.112,2.928,1.521,0.36,0.291,2.557,0.921,1.27,2.086,0.297,4.638,7.878,0.145,1.993,8.911,0.177,4.697,0.613,1.042,4.579,6.89,1.888,6.227,0.11,0.231,0.68,4.961,1.772,3.056,9.111,1.527,0.719,2.019,1.691,5.299,1.175,0.345,0.464,3.092,0.93,3.238,4.194,0.605,6.277,1.719,8.777,0.32,1.592,2.751,7.079,7.962,1.193,0.978,0.882,3.852,1.433,2.325,0.262,2.257,0.155,3.323,0.351,2.275,3.603,1.523,1.258,1.493,7.425,2.744,3.093,2.987,2.597,1.087,4.335,5.106,0.275,6.406,5.166,3.215,2.796,3.219,0.64,5.245,1.28,3.502,1.062,1.985,0.212,0.311,6.039,0.95,1.497,0.638,2.642,0.114,0.862,3.236,0.084,3.282,5.938,5.526,3.508,4.844,4.157,1.619,6.791,0.338,0.763,0.376,3.294,4.3,5.105,4.643,4.88,5.569,3.528,2.92,0.349,4.425,3.775,0.756,3.958,4.87,0.161,1.905,0.683,4.584,5.02,5.533,4.349,4.677,1.489,3.826,1.401,6.439,0.174,2.83,1.348,2.129,0.149,9.57,5.947,6.954,4.644,0.519,1.887,0.696,0.78,5.977,0.891,0.629,1.673,5.192,2.803,5.076,3.204,2.192,0.315,8.756,1.138,1.97,6.097,5.219,2.308,0.763,0.767,8.537,0.262,7.173,5.255,5.426,6.25,1.911,5.053,0.891,7.473,3.05,0.431,3.911,1.984,4.611,0.502,0.952,2.137,1.629,1.703,7.916,7.899,5.851,6.29,2.949,1.836,1.262,5.621,1.078,0.254,4.626,2.194,0.3,4.998,3.319,4.268,6.146,0.373,3.418,4.89,2.24,3.539,4.606,3.631,2.365,3.881,1.774,8.356,1.736,3.008,0.251,8.149,2.114,4.099,8.337,0.945,0.451,8.945,8.567,8.814,4.766,1.954,2.281,0.715,0.132,9.423,7.785,4.574,4.451,2.742,9.399,1.072,8.448,2.088,7.487,9.184,0.696,1.802,1.149,2.801,2,0.164,1.121,9.508,1.098,3.175,0.291,4.5,3.526,7.994,0.103,2.9,2.979,4.128,1.003,2.584,0.487,1.226,0.725,1.642,5.457,1.834,1.123,1.561,2.837,2.42,2.758,2.62,8.554,3.488,1.897,0.733,1.363,0.389,1.924,0.273,4.899,4.188,3.33,3.075,5.7,1.188,1.622,7.535,1.754,2.427,0.755,0.348,1.899,0.346,0.722,3.098,3.014,3.617,3.781,1.734,5.765,2.562,3.388,2.306,7.576,5.103,8.609,4.583,3.568,8.342,0.841,7.238,0.724,2.541,2.861,0.214,5.305,4.197,5.131,0.391,0.182,3.674,0.683,4.314,1.44,0.726,5.368,2.206,8.002,0.411,1.262,2.146,2.589,0.46,5.889,1.52,1.5,0.321,1.592,2.755,4.68,1.725,4.503,6.754,2.472,3.492,5.194,0.302,0.19,0.842,0.335,0.797,2.583,1.675,0.499,0.6,1.061,1.139,6.158,2.538,1.678,1.989,7.724,0.528,0.12,1.316,3.454,0.433,1.131,0.195,7.295,1.779,0.288,1.035,3.185,1.28,6.848,0.414,5.682,0.579,0.566,6.076,1.173,5.375,0.369,2.754,7.71,6.667,0.9,0.45,4.028,4.474,6.938,0.162,0.773,1.349,5.182,0.266,1.347,6.444,3.538,2.745,0.302,0.675,0.764,8.305,7.409,0.641,5.562,1.228,0.312,0.611,3.349,4.607,2.182,2.021,3.002,6.375,2.828,2.289,5.577,2.508,1.026,8.53,5.152,9.146,1.385,4.863,7.67,0.728,1.111,6.394,2.958,0.908,3.836,2.016,2.181,6.556,2.601,4.57,0.198,4.327,1.188,0.188,6.04,4.607,6.362,4.554,5.244,9.382,9.026,2.96,0.127,0.788,0.744,1.085,8.384,3.369,8.769,1.085,2.321,0.899,3.865,4.409,0.136,0.861,7.229,7.002,3.615,0.086,1.246,2.506,4.106,1.218,1.874,3.647,2.592,0.199,2.81,0.712,0.45,0.65,0.3,7.048,6.391,8.023,7.061,2.088,4.988,3.852,6.655,0.505,0.669,6.534,8.03,7.233,1.573,1.488,0.328,9.048,0.327,1.08,2.387,0.259,3.835,1.815,1.801,8.589,1.758,4.785,6.239,0.857,2.787,1.683,2.51,7.387,1.797,2.05,4.139,4.965,9.327,4.411,1.034,1.403,0.095,0.38,7.823,7.308,0.603,3.417,1.5,0.2,1.311,6.515,9.28,0.704,2.227,5.909,2.143,0.881,6.958,5.71,1.39,1.777,5.232,3.381,5.238,5.977,2.23,4.427,0.643,8.192,4.677,1.938,0.459,8.849,0.645,1.628,0.132,2.122,0.718,0.898,3.127,5.16,7.732,4.921,1.557,6.526,5.006,2.611,5.248,9.49,3.569,5.843,2.653,2.074,6.022,2.52,0.304,1.162,3.528,3.169,6.719,5.819,3.423,2.436,3.066,3.597,2.034,0.608,6.964,1.939,3.149,0.666,7.957,0.816,3.618,2.385,1.303,4.434,3.297,0.129,0.286,4.774,0.414,0.389,0.19,6.43,8.114,0.551,9.03,7.117,0.813,7.919,5.505,1.112,1.503,4.57,0.309,7.221,1.794,0.502,1.595,4.494,1.087,0.799,2.752,0.394,1.336,3.593,0.498,2.344,3.519,8.779,3.3,1.213,2.657,5.74,2.266,5.062,0.312,8.323,0.452,7.728,3.93,2.194,0.247,0.572,8.374,4.852,9.01,7.518,0.978,1.25,8.376,4.214,2.411,2.004,2.72,9.614,5.321,8.473,3.153,1.432,1.926,3.528,5.886,4.223,4.541,1.986,7.5,0.65,1.195,1.598,6.013,0.138,5.36,1.598,0.472,0.679,2.049,1.072,9.522,3.399,2.778,7.941,1.922,0.25,1.046,2.288,3.477,6.812,1.603,2.867,0.302,5.592,0.9,0.394,0.119,0.799,8.23,5.093,9.465,8.558,5.538,4.359,3.104,0.471,0.407,0.28,0.14,0.155,7.849,0.564,7.221,1.706,0.272,4.611,6.988,0.41,0.326,3.105,4.522,1.523,3.645,1.508,2.464,6.024,0.21,4.6,1.714,2.5,6.071,4.336,3.478,0.771,7.924,0.964,2.011,7.664,1.777,1.416,0.074,0.872,3.127,3.297,6.294,0.248,3.09,4.025,5.208,0.269,0.534,4.45,0.27,5.761,2.25,1.407,5.495,0.036,0.739,3.194,0.338,0.298,2.427,0.356,2.477,0.736,5.663,2.271,6.908,5.104,0.231,5.825,7.662,1.808,8.011,0.376,6.14,2.397,2.088,5.792,4.033,7.555,4.111,0.122,5.011,0.27,4.599,6.08,7.154,3.652,3.565,8.44,0.235,1.854,0.093,3.118,0.381,5.094,0.758,0.445,0.094,3.304,0.328,2.611,0.973,0.22,3.535,6.301,2.103,1.318,2.989,6.677,8.218,4.673,6.035,4.228,2.782,8.462,4.09,3.953,0.26,9.048,0.281,0.715,6.668,1.671,0.701,1.646,7.381,1.329,1.135,7.658,0.794,5.902,5.647,6.69,4.222,6.652,3.087,7.356,7.804,1.306,7.486,7.68,2.406,2.634,7.234,4.272,0.928,2.516,0.899,1.65,7.439,5.711,2.89,2.882,2.123,5.907,5.567,5.564,1.773,6.574,1.75,8.831,0.45,1.227,1.065,7.956,0.457,4.24,4.741,0.446,3.699,3.675,7.084,2.29,1.699,0.6,4.243,1.352,5.505,1.526,2.505,3.195,6.499,0.564,2.629,7.517,5.426,4.022,0.884,2.667,3.046,2.807,1.717,1.355,0.502,8.708,0.586,3.332,3.462,2.028,3.973,2.855,0.194,1.315,4.683,5.263,0.762,2.756,3.293,8.483,4.329,0.311,0.494,0.355,0.499,0.703,1.41,1.496,1.035,3.501,1.486,2.491,1.029,2.084,7.195,7.258,2.106,8.675,0.161,8.879,0.774,1.932,6.85,0.879,0.248,4.568,4.218,0.357,8.863,1.742,9.341,0.228,2.339,9.466,0.724,0.393,9.638,7.055,0.246,2.348,3.669,0.989,1.515,1.381,3.049,1.036,6.974,7.673,7.757,5.751,0.891,5.17,4.169,5.025,2.582,0.169,1.586,8.899,2.018,1.036,7.941,1.408,0.719,0.291,9.03,2.908,3.254,0.748,7.034,3.937,5.972,2.309,7.771,0.442,0.65,6.405,8.656,4.685,1.113,2.055,0.702,0.118,3.227,4.57,5.307,2.699,1.349,1.782,4.609,2.31,6.634,0.685,1.89,3.68,3.396,0.903,8.735,0.292,1.61,0.881,2.041,3.405,4.604,1.364,9.53,0.941,3.61,0.113,0.977,1.47,0.665,8.447,4.527,0.818,7.731,0.223,9.394,4.952,2.37,5.049,3.414,6.052,5.821,2.43,0.325,0.63,0.429,9.857,8.403,3.97,0.256,5.538,0.931,1.662,1.099,3.701,4.119,2.861,7.043,0.315,2.793,2.977,3.31,0.111,8.841,2.947,7.5,0.328,0.215,1.344,0.675,3.988,7.77,1.098,0.197,0.439,2.894,3.119,2.384,0.187,0.401,2.461,7.213,0.492,1.212,2.023,2.237,0.187,0.841,1.402,1.867,1.693,2.214,5.002,0.862,1.085,1.841,0.749,1.44,7.938,2.257,3.338,1.299,3.23,1.743,1.052,9.494,2.925,3.861,5.751,2.308,1.493,1.143,7.08,0.393,7.031,3.361,1.475,3.815,1.772,5.291,4.35,4.681,1.517,7.783,0.371,0.523,2.52,3.088,0.316,4.82,5.518,5.029,0.155,3.632,6.299,9.637,1.787,4.954,0.198,5.007,2.464,4.993,8.919,1.065,4.441,1.268,4.854,0.215,3.885,3.93,3.191,2.596,8.044,3.327,0.25,0.124,0.18,6.064,0.456,2.123,0.261,2.028,1.065,4.646,0.77,3.529,9.42,4.443,1.354,7.63,0.937,7.512,6.162,0.417,0.398,0.667,4.445,3.526,5.441,1.751,3.091,2.484,1.088,0.703,2.725,1.33,0.416,1.222,4.69,0.739,4.169,5.011,2.079,2.088,0.269,4.961,1.836,6.927,9.402,3.091,0.438,6.178,1.426,0.109,1.494,3.473,0.933,2.89,4.628,5.869,1.658,9.518,5.383,0.353,0.072,1.078,9.235,0.388,3.147,1.046,3.341,0.522,0.94,6.519,2.878,0.658,6.935,2.539,1.11,4.985,2.986,5.172,0.787,0.164,9.359,0.237,2.735,1.192,3.028,5.005,4.875,6.172,5.341,0.424,0.257,0.869,0.21,5.805,2.25,0.244,4.341,0.825,0.144,1.057,2.025,7.046,3.433,2.076,0.445,8.144,6.483,4.508,0.995,1.914,0.563,0.231,1.516,2.573,1.247,3.158,3.298,4.746,0.316,4.268,3.709,3.848,0.692,6.133,0.289,4.92,5.281,2.402,3.056,3.315,1.473,0.157,0.762,4.027,8.809,0.884,5.973,3.58,4.752,4.944,3.183,1.405,3.552,1.001,0.108,2.441,3.269,2.302,2.393,6.41,5.585,6.676,5.635,7.132,9.714,0.513,4.841,0.597,0.814,0.6,4.949,4.912,1.009,3.392,4.036,0.476,0.397,4.565,1.435,0.472,9.056,4.11,0.155,1.71,0.378,5.368,2.295,1.956,0.937,1.032,0.186,2.728,3.895,8.837,1.406,3.623,2.303,7.451,4.266,1.235,3.476,9.323,0.988,0.776,0.312,8.264,0.897,0.571,3.443,0.466,0.851,1.826,0.232,1.481,2.946,2.356,1.663,4.637,8.025,9.973,6.805,9.229,0.521,6.274,4.162,0.845,2.038,0.716,0.851,1.983,0.99,3.408,4.014,0.369,8.999,0.816,0.722,0.774,3.246,8.578,8.108,0.821,1.869,0.344,0.456,1.69,3.072,1.799,0.904,2.04,0.408,3.278,1.851,1.6,2.086,3.464,2.404,0.67,1.205,1.231,8.607,0.399,4.117,1.723,5.223,5.044,4.505,0.688,1.41,3.252,1.793,0.326,6.506,7.793,1.536,0.889,2.61,0.788,2.808,0.323,0.228,1.131,0.161,9.041,2.311,3.747,0.298,8.086,0.481,1.598,5.28,0.232,2.541,2.44,5.395,3.597,1.375,2.878,0.206,7.178,0.271,5.007,2.277,0.068,0.597,4.775,0.436,0.567,7.53,7.576,3.831,1.166,0.275,0.157,3.005,6.491,1.527,1.92,8.668,0.18,8.33,3.959,9.071,0.178,1.213,1.178,3.663,2.861,6.793,1.589,4.536,1.431,2.293,7.047,0.514,8.83,4.504,9.054,2.086,1.6,0.92,0.213,3.862,0.536,3.314,1.872,0.559,3.408,3.818,7.313,4.547,1.757,1.442,0.61,0.915,4.466,0.93,2.202,5.913,4.02,2.109,1.884,1.048,5.167,3.732,8.795,0.115,4.055,5.648,1.101,4.951,1.331,1.119,6.141,0.139,4.227,2.423,4.321,0.743,3.666,5.408,0.346,0.915,0.98,5.17,7.048,6.587,6.287,0.712,1.822,1.763,2.85,0.573,7.349,0.388,1.768,0.558,6.789,2.183,8.808,0.188,0.663,0.159,2.417,1.636,0.872,5.146,0.171,1.888,7.609,6.602,0.829,2.861,1.497,3.363,1.967,2.143,1.836,0.51,3.505,5.504,5.464,9.482,4.036,3.69,1.584,1.86,0.871,0.522,3.59,1.302,0.914,5.384,5.312,1.044,5.1,0.632,4.103,2.109,7.972,1.798,1.426,6.701,0.48,5.767,4.195,0.926,9,0.539,6.798,0.954,4.17,3.246,2.668,6.502,1.797,1.511,1.007,0.866,2.408,4.56,6.465,1.599,3.75,6.947,3.093,3.047,8.768,3.017,0.627,9.584,1.953,5.317,4.725,0.252,4.629,1.923,1.93,0.049,7.345,2.092,2.863,9.133,7.107,0.49,7.837,1.614,1.321,7.779,4.941,2.058,2.389,9.305,0.214,0.734,5.745,0.671,1.67,0.335,0.413,8.861,0.901,1.755,5.757,2.31,2.692,0.326,6.907,2.098,0.339,6.439,1.398,3.915,4.216,5.899,8.654,1.029,7.547,6.106,9.341,4.667,0.461,2.964,0.352,0.779,5.201,1.258,5.568,8.356,0.527,1.73,0.407,2.453,0.086,3.612,0.679,3.197,3.887,5.735,0.397,2.107,7.218,0.587,5.792,3.987,1.141,0.148,7.051,1.026,0.559,3.292,1.876,6.183,1.062,8.939,1.293,1.491,1.573,1.693,6.488,8.538,7.406,3.938,1.859,3.485,4.956,4.924,0.496,9.273,0.204,0.527,8.306,0.868,1.248,3.446,1.813,1.922,0.332,2.731,7.988,0.915,5.315,7.194,4.955,0.638,5.234,1.925,8.377,0.801,0.156,2.974,2.428,4.326,1.413,8.952,0.139,0.413,7.337,7.583,1.194,3.266,2.586,3.734,3.957,1.421,7.091,3.628,4.562,3.126,1.361,3.351,3.35,2.793,0.744,0.469,0.228,0.256,0.349,1.33,5.638,4.215,1,0.19,1.195,1.502,0.688,2.348,0.377,3.796,7.173,0.241,2.745,0.996,1.189,0.929,1.499,0.792,0.408,0.679,7.544,7.87,6.391,2.849,8.271,0.801,4.729,0.671,5.769,2.211,1.01,0.22,0.255,3.677,3.829,6.729,2.559,2.941,0.928,1.924,4.455,0.894,3.024,0.643,2.329,0.799,5.419,6.236,7.404,0.775,7.449,0.312,9.362,9.85,6.456,3.43,0.868,1.509,1.325,0.246,1.005,4.273,1.086,9.239,5.634,9.73,2.697,9.365,1.869,8.811,5.789,0.157,0.507,2.816,3.139,3.633,8.578,0.515,0.488,5.951,0.927,5.189,7.287,2.708,3.062,0.717,1.442,4.766,1.76,6.444,2.838,3.877,4.578,5.511,1.466,2.33,3.996,1.403,2.557,3.373,3.256,0.466,3.093,7.349,2.821,0.836,0.299,0.698,1.133,3.607,1.883,0.117,6.33,1.343,5.818,8.669,3.892,3.082,0.338,4.807,0.744,4.036,9.717,2.6,2.561,7.144,0.336,0.568,3.525,9.234,6.199,1.608,0.259,2.954,7.694,2.57,1.287,6.757,1.456,1.42,1.652,0.351,7.511,4.52,0.376,0.245,4.963,2.299,3.659,6.484,1.414,2.387,3.453,5.663,0.136,6.671,3.642,0.78,2.82,7.696,2.914,4.592,1.137,2.838,0.961,1.605,2.187,4.466,2.008,3.481,0.96,5.061,4.359,0.289,3.322,0.789,7.563,0.172,2.235,0.272,2.454,0.561,0.192,2.119,1.375,9.708,4.048,0.364,1.519,0.774,0.38,5.199,0.218,0.933,0.194,6.414,0.539,0.706,2.121,1.551,9.521,7.083,0.703,1.822,0.644,1.244,0.354,2.28,0.24,5.463,0.76,0.296,4.052,6.539,1.899,2.778,2.99,5.231,1.658,5.054,0.588,1.591,0.966,1.875,0.195,0.214,3.4,0.378,2.506,9.159,4.108,3.065,3.11,3.99,1.994,1.209,9.504,3.595,0.578,1.499,7.631,1.625,6.451,0.277,2.052,5.064,7.228,0.846,0.593,0.844,0.535,5.657,2.7,0.845,1.882,0.751,7.967,4.873,5.254,2.334,3.608,4.036,3.192,2.738,3.289,2.241,7.511,0.527,0.366,4.738,7.509,2.468,2.646,1.511,0.317,5.045,5.368,0.163,6.698,0.706,3.914,7.264,2.827,0.259,0.402,1.01,0.665,0.654,1.468,0.441,2.146,9.537,4.824,0.172,3.887,4.519,2.055,6.535,0.467,7.782,4.542,8.804,8.95,1.549,2.447,0.94,6.067,3.993,7.115,2.721,3.949,0.209,3.806,0.23,3.173,1.789,4.941,1.992,2.593,5.406,0.295,0.104,2.005,0.515,0.801,8.064,5.514,3.149,1.74,3.885,1.008,8.814,6.865,0.667,0.448,5.772,0.208,2.165,4.006,0.089,0.353,0.16,3.684,5.076,6.833,8.724,7.694,1.638,1.987,0.757,1.7,6.039,2.063,0.768,2.526,1.815,4.459,7.232,0.462,7.268,3.366,4.428,7.261,0.498,3.713,3.918,5.237,5.305,7.964,0.244,3.706,0.638,0.436,7.444,9.666,1.091,7.138,7.666,1.259,0.239,5.888,6.567,2.432,1.951,1.942,0.53,1.343,5.995,2.524,1.199,2.693,2.123,0.978,6.781,0.322,1.379,0.426,1.972,0.279,3.694,4.088,6.337,5.882,8.176,7.22,3.294,0.823,0.512,8.169,0.163,4.286,3.085,1.067,1.093,8.253,1.883,3.143,6.693,2.581,0.31,1.787,2.925,2.69,3.605,6.25,6.689,4.209,3.001,4.079,0.928,1.141,2.655,2.206,1.961,4.627,0.888,1.439,7.262,2.257,1.051,2.06,7.353,1.129,0.764,0.441,3.483,0.671,4.021,0.156,0.203,3.405,9.136,3.529,1.482,4.575,1.347,1.569,5.752,5.702,8.315,0.356,6.281,0.754,8.243,3.164,0.463,6.503,5.687,1.33,0.105,6.214,7.002,8.396,7.803,1.658,0.6,0.224,0.957,0.552,0.419,1.379,1.249,2.79,5.153,2.919,2.469,1.706,4.444,5.173,1.852,5.717,6.671,2.568,3.752,0.92,7.872,5.073,3.882,8.626,5.055,3.28,9.196,2.976,8.044,1.434,4.555,6.396,4.242,3.987,2.559,0.847,4.474,4.793,0.511,2.57,0.545,7.594,1.086,2.767,8.114,7.61,4.292,3.265,8.094,0.463,2.888,5.609,6.92,0.543,4.487,5.657,1.429,0.185,0.459,8.288,3.538,0.894,0.477,6.134,5.095,8.14,0.928,0.922,5.5,0.643,5.81,0.829,4.35,5.238,2.816,3.858,5.96,1.775,3.205,2.322,0.898,5.359,2.338,4.643,0.21,4.673,0.178,8.815,0.611,0.358,7.536,1.905,1.141,0.603,0.144,2.018,1.755,7.25,8.799,0.134,0.149,4.022,0.93,0.877,2.877,3.754,1.527,8.537,3.487,7.74,0.874,4.32,2.371,4.582,1.487,8.887,6.694,0.277,7.756,3.285,1.138,2.79,4.611,4.222,7.452,3.806,7.028,7.56,0.689,2.197,3.34,1.176,0.388,0.083,4.098,1.203,5.913,0.594,6.121,1.617,0.407,0.651,0.762,0.209,8.12,4.058,0.253,2.379,4.048,9.344,2.719,4.75,4.96,2.481,4.139,1.113,5.465,2.194,2.999,2.338,3.416,2.415,1.481,1.233,3.429,5.459,8.307,3.961,4.44,3.864,4.809,2.173,1.359,4.579,4.643,1.696,1.422,6.888,0.513,0.03,4.016,3.972,3.518,2.682,0.816,5.806,6.597,1.887,5.899,3.714,1.451,0.99,7.287,0.987,3.261,2.113,8.75,8.766,8.923,2.171,0.816,6.204,0.26,0.072,0.813,2.403,0.594,4.148,7.908,8.199,0.141,1.889,2.728,4.719,3.191,0.13,7.171,4.611,3.968,2.273,4.152,0.206,3.881,1.55,1.403,1.741,7.416,4.14,2.067,6.502,3.738,2.778,2.061,3.831,8.901,0.201,6.236,5.92,6.222,1.075,6.651,5.291,3.517,3.248,8.861,6.806,1.245,9.419,0.927,6.139,7.851,4.05,4.991,1.249,4.539,8.456,4.162,0.259,0.497,4.424,3.727,4.363,0.715,6.724,0.629,5.24,4.092,5.171,3.492,3.093,4.793,8.145,2.955,0.804,1.44,8.765,2.045,5.023,0.416,2.15,0.471,6.826,3.54,0.176,1.848,2.198,4.932,3.511,6.609,4.845,8.876,3.725,8.629,4.18,0.614,3.938,0.716,8.275,2.724,1.207,0.106,0.146,4.791,6.458,0.249,3.313,3.36,0.369,0.285,0.552,0.431,7.654,0.945,2.898,2.242,2.619,1.202,6.19,0.289,1.801,1.077,0.416,0.97,1.975,5.456,3.438,5.052,1.945,4.218,2.796,9.025,0.694,1.019,2.833,8.3,1.126,1.256,8.768,8.914,3.44,0.284,2.455,7.277,3.933,1.127,3.56,3.786,2.963,0.638,5.183,7.505,7.701,5.718,2.5,3.9,0.184,6.27,2.421,9.04,4.548,2.553,2.286,6.295,3.385,0.659,1.533,5.293,1.663,8.135,1.456,4.725,2.403,4.931,1.194,5.593,2.755,1.891,0.64,6.668,1.106,7.888,6.643,8.279,9.101,9.839,0.559,0.77,2.561,1.379,0.945,6.716,0.551,0.817,0.475,2.06,5.455,1.419,7.664,1.504,0.62,0.789,3.446,0.912,6.165,3.246,0.237,0.835,6.736,1.782,2.855,8.475,2.513,0.334,2.522,3.743,0.836,2.622,1.493,0.271,0.205,0.659,0.535,5.897,2.103,7.574,8.097,5.215,4.059,9.2,5.035,4.673,4.124,2.86,1.171,6.146,4.76,7.641,1.044,5.142,0.893,2.716,0.173,7.754,0.168,3.401,8.111,4.331,0.859,4.057,1.131,0.887,1.086,9.092,0.072,3.826,2.649,1.806,1.926,0.475,5.438,5.079,3.038,0.054,3.705,1.414,0.562,4.395,0.615,0.789,0.808,7.886,2.474,2.801,3.214,0.431,2.329,1.001,3.602,2.236,1.52,2.36,6.23,1.231,0.97,3.285,3.616,1.68,0.37,0.051,0.857,6.429,0.549,8.672,4.405,1.892,2.082,2.79,8.602,0.908,1.534,1.384,0.937,0.79,9.092,8.993,5.249,1.776,2.207,2.273,0.287,6.798,0.883,9.165,0.22,6.302,1.998,0.536,0.432,0.774,2.253,0.33,4.768,3.16,2.935,7.172,3.674,3.822,2.207,5.438,1.033,0.304,5.944,0.802,0.991,0.137,1.595,0.778,1.309,5.045,4.236,1.674,0.422,7.826,1.273,5.633,3.203,2.39,3.95,1.031,4.516,2.095,0.683,0.302,1.569,6.799,6.487,1.734,1.96,5.409,0.212,2.732,4.196,2.286,5.433,0.472,8.851,6.116,0.073,5.438,1.004,4.745,2.796,2.434,2.843,2.011,0.211,0.092,7.743,0.804,8.474,3.595,3.985,8.989,7.413,0.613,7.97,2.217,4.505,0.359,5.076,0.456,1.868,1.41,0.984,1.164,2.333,7.089,0.267,0.257,0.142,0.523,6.491,0.87,2.658,4.974,2.582,1.178,2.534,0.687,4.527,5.704,6.902,3.776,0.64,7.76,1.344,9.604,2.048,1.883,1.041,4.435,2.008,3.185,0.568,9.45,1.403,4.176,0.476,0.622,2.405,8.811,2.895,4.709,7.322,3.233,0.349,0.35,3.667,6.223,2.967,9.511,1.081,0.083,8.681,2.234,3.112,1.118,3.749,0.339,0.475,9.08,0.358,0.217,3.448,1.026,0.41,0.906,1.236,0.113,5.585,1.454,1.122,7.464,0.461,1.158,3.716,4.146,6.116,0.533,2.121,0.439,5.916,7.76,5.099,2.112,3.079,5.245,2.781,1.007,6.102,3.993,7.667,1.766,4.123,0.361,3.63,4.585,0.302,1.733,3.221,1.709,0.461,1.763,3.691,0.165,8.304,0.208,9.551,1.707,2.262,0.628,0.615,9.311,4.35,7.03,4.023,4.038,1.159,1.896,0.356,8.873,0.263,4.841,9.244,5.868,2.783,0.078,1.248,1.401,8.765,8.891,0.742,1.408,0.407,7.949,3.973,1.344,0.989,1.917,9.122,1.344,0.669,1.175,0.584,3.856,0.268,0.175,3.043,1.901,1.392,4.079,6.262,2.443,7.837,0.698,8.435,0.726,2.323,7.577,0.438,2.637,2.328,1.981,2.446,1.443,0.972,2.351,0.116,1.793,5.33,1.892,2.534,2.67,0.579,1.78,1.424,0.687,7.999,1.636,0.172,6.514,0.599,4.498,0.326,6.014,2.085,0.78,9.476,2.034,0.404,4.804,1.335,0.53,3.966,8.245,0.595,5.985,1.631,9.279,0.041,2.283,6.599,5.362,1.968,0.968,2.96,9.59,2.951,1.582,0.178,7.129,8.254,0.395,3.123,2.672,0.493,0.388,9.304,1.76,1.762,0.68,5.306,0.475,0.88,1.06,0.928,2.348,4.938,1.232,5.224,1.291,1.816,4.222,1.614,5.602,0.376,0.202,5.376,0.287,6.046,4.962,6.236,0.647,0.525,3.661,1.895,6.718,1.935,1.813,2.661,2.543,5.842,5.734,3.234,1.08,5.114,0.256,0.09,1.929,7.226,5.478,7.303,3.78,0.477,6.413,1.066,0.084,2.439,0.82,0.187,7.049,0.784,3.334,6.55,0.564,5.06,5.729,4.955,0.173,8.734,1.645,3.476,9.287,2.402,1.577,1.494,8.251,3.877,0.794,3.064,0.619,0.233,0.295,5.176,2.167,1.92,3.893,4.246,3.47,2.035,3.596,6.002,1.916,3.993,2.688,1.548,7.358,2.521,2.186,0.32,0.166,5.488,0.759,8.138,5.209,1.93,6.362,3.274,5.668,8.806,0.497,2.668,7.981,1.345,6.124,0.095,1.03,7.363,1.73,0.162,4.167,2.596,3.38,0.922,7.278,1.705,0.297,7.052,2.136,8.118,0.73,4.385,2.068,8.34,8.027,1.782,2.911,0.199,4.85,2.423,4.375,5.141,0.261,9.858,0.355,6.68,0.649,7.104,8.592,4.098,4.625,5.199,7.647,0.803,8.398,0.756,1.533,1.49,2.263,6.344,0.791,3.314,1.611,0.768,7.811,2.289,9.186,1.4,3.501,7.245,0.323,4.815,5.916,5.68,0.778,0.252,9.439,1.843,1.267,0.453,0.987,4.404,1.359,1.64,0.622,1.364,0.545,7.336,1.157,6.9,0.986,6.417,1.145,7.997,8.429,0.227,2.877,1.039,5.442,7.536,1.204,0.804,3.821,6.509,3.271,3.247,3.447,0.323,5.407,4.669,2.581,7.283,5.387,4.934,0.164,0.431,6.685,8.595,9.385,1.074,6.831,1.791,0.565,0.155,2.39,0.156,3.205,0.432,0.734,2.071,3.958,0.507,0.586,0.907,1.499,2.23,0.449,0.759,4.521,1.119,7.28,1.29,1.055,7.095,0.038,4.288,6.821,0.708,3.791,2.208,8.547,0.25,0.899,1.072,1.894,1.731,0.469,4.465,4.653,1.276,0.957,0.988,1.871,3.023,3.231,4.788,1.683,6.624,1.073,1.406,3.769,2.015,0.242,6.278,2.329,0.757,1.376,0.681,3.753,4.664,1.395,4.515,1.681,2.368,2.25,0.402,1.942,0.256,2.024,3.955,7.434,0.295,0.622,1.401,7.255,2.123,3.199,5.262,3.969,9.048,1.131,1.525,2.81,7.053,4.3,4.419,1.586,6.535,3.796,5.745,1.073,9.317,3.821,4.344,1.213,3.42,0.808,1.429,5.12,1.631,6.889,8.136,4.2,2.646,0.461,3.498,3.681,1.631,1.345,0.494,2.043,3.619,3.638,1.305,1.175,2.27,0.666,1.062,1.152,1.263,1.268,7.775,2.423,0.999,3.16,0.649,5.27,0.068,3.782,8.328,4.119,0.426,7.865,0.503,6.163,4.844,4.326,4.271,3.073,5.771,5.164,0.417,7.205,4.748,4.272,5.084,4.842,3.387,0.799,0.117,4.587,8.088,1.178,2.255,4.598,0.729,8.811,7.985,0.244,3.203,9.019,1.882,0.784,1.123,0.595,0.849,0.607,2.347,7.935,1.772,2.136,6.023,7.962,3.464,6.602,3.43,6.722,3.562,4.492,3.501,0.781,0.458,5.372,0.268,1.058,3.707,5.721,9.52,0.275,1.201,1.345,0.164,2.838,7.572,1.466,6.21,1.977,4.572,8.2,3.844,2.967,1.764,8.609,2.552,2.109,9.48,4.783,3.635,1.364,0.76,0.873,0.497,1.364,5.999,5.284,3.572,4.292,0.86,1.232,5.558,5.169,2.795,1.771,0.129,2.777,6.214,4.532,9.002,3.746,5.295,6.509,7.007,2.949,1.82,2.668,1.533,5.397,1.67,3.921,0.463,0.166,0.675,1.359,0.934,5.522,4.991,2.974,2.422,0.25,5.605,0.399,2.426,7.793,4.492,3.646,0.975,5.097,0.463,4.638,2.372,1.498,2.415,0.779,2.407,0.85,9.107,2.569,2.582,0.136,1.725,5.024,1.449,2.136,1.895,0.809,0.415,0.207,5.31,3.799,4.507,1.445,8.146,4.421,0.773,4.987,6.677,0.196,0.895,4.014,1.03,0.151,3.887,2.536,2.358,7.415,2.233,1.216,1.379,5.156,0.732,5.826,0.418,2.971,0.296,6.561,6.336,0.87,0.207,4.676,6.315,6.171,7.844,0.13,6.23,1.45,8.456,6.471,2.475,6.097,0.442,1.238,2.472,7.171,7.101,2.511,3.139,9.054,6.299,1.894,1.261,5.343,2.748,0.704,0.916,7.714,2.41,1.476,1.147,2.331,7.953,2.33,0.106,0.255,1.997,6.394,3.797,4.33,0.29,1.988,0.108,3.045,8.722,0.608,2.038,2.714,0.685,0.515,1.297,2.697,5.004,4.121,4.767,0.569,7.997,3.183,0.5,2.051,6.019,1.737,5.628,2.18,2.809,1.932,0.441,8.272,3.254,2.404,2.329,7.563,0.156,2.032,2.22,0.051,4.637,2.813,4.626,6.142,3.7,8.014,2.051,0.312,6.394,1.79,3.24,6.601,6.682,0.984,5.197,0.642,0.345,0.405,1.801,3.132,4.218,3.844,1.408,1.584,1.228,0.332,4.572,8.062,6.717,4.646,0.461,0.828,1.312,3.164,1.498,0.886,1.872,0.859,0.238,0.367,5.05,2.427,2.852,3.312,6.563,5.289,2.763,1.909,6.196,2.618,1.331,3.138,0.592,2.49,7.332,9.637,6.209,1.525,3.18,0.062,1.63,7.737,0.789,0.333,0.909,0.778,3.66,2.058,5.217,0.082,0.074,0.466,2.725,0.658,0.225,3.919,0.748,4.933,7.09,3.58,7.052,4.236,2.638,0.374,0.201,0.709,4.627,0.745,1.024,7.668,4.829,8.795,0.147,8.416,9.514,5.416,4.592,0.074,7.346,1.193,2.558,0.788,0.125,0.836,0.891,2.246,0.816,2.152,1.098,0.292,8.891,0.344,2.069,7.637,1.43,0.584,7.681,2.955,0.51,1.935,0.188,2.825,1.751,1.213,0.662,8.869,9.767,0.805,9.664,0.661,1.231,2.119,1.016,3.155,4.762,2.056,2.352,5.079,3.146,4.291,1.46,0.466,7.363,2.936,6.845,7.258,1.382,9.272,8.456,3.362,0.95,7.129,4.909,0.376,0.441,7.567,2.774,9.846,1.691,1.809,4.955,1.493,0.772,0.424,7.306,3.686,0.292,6.085,1.718,6.573,6.879,5.086,3.894,2.439,2.064,1.564,4.741,0.654,1.644,5.149,5.98,7.268,8.727,8.012,8.005,3.426,3.96,0.206,6.715,6.051,4.68,0.69,4.089,0.465,2.497,0.424,3.807,6.775,1.005,7.141,0.564,1.471,5.999,0.135,1.901,7.857,4.243,5.941,2.394,9.142,9.676,8.97,1.272,9.078,0.387,3.811,0.489,0.848,7.687,6.001,9.328,5.523,7.56,2.225,6.153,6.33,5.187,7.859,0.04,3.894,7.434,4.416,0.518,0.483,1.083,6.539,2.937,2.138,1.766,0.34,4.251,1.629,1.421,7.655,5.742,2.196,3.954,1.75,2.098,2.801,0.547,3.224,9.547,2.168,1.721,2.097,9.206,5.054,1.105,0.233,0.213,0.748,0.791,0.678,2.526,2.614,6.792,6.298,4.014,8.302,0.303,0.95,1.572,9.833,1.284,0.45,1.78,4.667,4.65,6.88,2.642,1.039,3.987,5.121,4.201,1.606,2.589,1.305,1.967,1.186,6.645,6.172,3.259,4.612,0.508,5.135,0.819,0.346,5.961,7.915,0.125,4.03,4.876,0.247,0.649,8.212,7.878,6.12,3.427,7.853,1.96,2.007,0.187,5.566,4.077,0.277,0.508,8.521,6.691,0.183,5.7,0.164,8.762,0.343,6.38,3.536,4.535,3.01,2.249,0.492,1.268,2.762,2.923,5.96,3.888,3.413,3.787,3.882,2.473,2.537,7.738,0.451,4.489,6.784,9.194,2.415,2.461,0.532,4.078,7.752,2.875,3.552,0.395,6.735,1.785,4.704,5.784,1.216,6.798,0.552,2.001,0.895,0.172,1.016,2.012,0.561,0.833,2.729,2.81,1.092,3.165,0.397,4.587,2.914,3.231,8.181,1.729,1.811,0.575,2.27,3.529,5.558,1.738,3.014,0.414,3.45,2.426,9.525,1.942,3.754,2.541,0.467,0.428,0.604,3.34,2.608,3.798,0.583,0.559,1.09,4.558,6.058,0.522,0.507,6.319,5.208,2.816,1.028,0.366,2.527,7.776,0.627,5.503,0.839,5.988,2.799,0.53,9.768,3.967,5.298,4.492,1.185,7.867,4.884,4.5,2.825,6.7,6.319,8.257,0.735,8.903,0.986,1.126,2.537,5.52,1.33,1.164,2.898,8.454,0.442,0.153,0.373,5.189,3.494,2.379,3.647,3.06,0.252,2.983,7.684,2.407,0.487,1.972,0.677,0.28,7.055,4.699,0.376,0.752,4.107,1.857,0.91,0.297,0.234,2.329,3.747,3.624,1.207,8.465,4.201,0.34,4.13,1.169,4.548,0.074,3.973,0.633,0.116,1.748,2.234,3.604,2.102,0.279,7.387,9.877,0.714,3.938,1.247,0.685,9.524,0.506,5.784,0.471,2.186,4.12,7.134,0.6,1.99,3.106,3.333,1.512,1.16,0.382,4.18,0.423,4.172,2.541,0.933,0.826,7.774,1.537,3.008,0.125,0.65,4.558,0.136,3.115,5.051,6.995,6.74,0.564,1.963,3.093,3.323,7.823,1.21,1.992,3.022,0.185,1.542,2.144,7.118,0.917,1.312,4.643,1.907,1.923,0.547,6.173,1.731,4.06,8.32,1.658,2.265,4.773,0.843,0.92,5.869,2.447,6.209,7.594,0.137,3.032,2.364,1.881,1.486,1.725,0.681,0.195,9.492,3.412,1.957,3.006,0.291,0.371,3.333,0.507,3.269,4.641,1.966,1.362,2.592,0.287,2.875,7.613,9.468,0.794,7.953,0.136,0.259,2.603,0.534,0.374,0.94,6.248,6.705,0.541,1.647,2.624,1.475,2.81,1.325,1.301,8.975,5.26,1.758,3.629,3.851,0.553,0.498,3.018,0.732,5.238,6.126,0.55,0.484,1.069,1.248,5.952,7.307,3.019,6.447,7.195,7.711,7.976,6.61,7.418,8.175,4.37,4.355,8.465,1.566,0.66,1.062,3.498,4.784,0.81,1.699,0.283,8.539,0.478,0.202,5.839,1.873,0.784,0.674,0.602,2.507,0.855,2.783,8.996,0.23,0.707,1.943,0.186,2.846,3.158,7.127,7.684,0.554,0.933,0.881,8.295,0.457,0.139,0.254,2.359,0.516,0.447,0.971,9.384,1.832,7.842,3.34,2.153,4.424,1.979,0.509,5.077,0.57,1.484,0.076,1.463,3.55,6.644,3.939,2.276,5.126,0.32,3.365,2.343,5.83,2.621,2.579,0.3,3.778,2.008,2.393,2.474,1.334,2.516,0.749,3.164,4.215,0.457,8.217,8.721,0.18,0.26,1.043,2.52,2.537,9.288,4.373,3.095,4.677,2.686,4.749,6.017,7.095,9.653,6.051,9.629,5.313,8.305,1.838,8.91,1.767,0.381,3.206,1.969,1.303,1.541,5.811,1.134,2.882,1.497,0.386,0.717,0.255,7.389,1.081,0.868,5.287,7.191,8.814,1.361,7.79,8.381,0.973,8.534,0.369,3.027,4.114,7.253,2.047,6.432,1.643,3.564,1.054,0.772,0.634,2.302,7.054,1.573,4.981,3.021,2.922,3.455,4.416,2.088,7.096,0.269,0.72,5.195,0.347,5.26,8.869,6.142,3.584,5.738,0.095,2.333,9.097,4.175,2.472,2.1,3.957,6.993,5.104,1.032,4.504,2.453,0.701,5.605,7.324,1.378,6.197,0.348,2.989,3.071,2.312,1.582,0.804,0.355,1.573,1.764,3.015,7.414,8.028,2.652,3.216,1.084,2.42,2.667,7.501,8.777,3.485,0.139,5.782,5.088,0.242,6.951,9.411,0.871,5.011,9.461,0.858,0.964,4.387,6.915,2.23,0.847,1.262,7.998,3.498,0.342,4.713,4.64,8.866,3.554,3.287,3.691,0.652,1.584,1.802,4.758,1.022,0.245,5.298,2.034,2.359,1.383,4.175,2.309,0.238,3.313,3.151,1.603,8.601,2.786,7.841,6.311,1.483,0.972,2.499,3.439,0.173,2.331,7.837,0.62,2.251,0.532,2.083,0.574,8.272,4.206,6.743,9.005,2.296,0.123,7.44,1.39,2.47,4.909,0.655,2.359,6.364,3.585,1.785,4.477,5.948,0.177,5.075,5.233,2.058,3.095,7.854,1.188,3.78,0.902,9.358,7.244,0.701,9.193,0.835,8.052,9.748,8.815,4.144,1.393,2.318,3.664,3.918,6.657,2.915,7.821,0.744,1.695,5.474,3.068,0.338,4.292,7.858,0.677,2.643,0.357,3.313,0.401,0.897,2.712,3.442,4.396,1.335,9.497,2.679,8.866,0.623,3.96,6.024,6.394,0.505,1.648,0.199,0.877,1.938,0.348,0.452,5.753,9.021,7.129,3.859,4.997,0.119,3.309,2.672,2.991,0.245,1.116,0.299,6.762,5.731,0.4,0.445,2.558,2.624,4.446,3.556,4.651,4.431,6.61,7.914,0.462,0.37,3.122,0.419,3.863,2.122,3.749,7.708,2.652,0.472,1.912,0.242,4.106,0.265,0.947,0.074,0.97,0.596,1.96,2.153,5.263,1.98,0.444,5.216,0.343,1.887,0.509,1.749,3.893,1.676,0.292,7.185,3.029,9.577,2.742,0.386,2.59,2.689,0.252,2.208,0.426,0.659,0.282,2.344,2.952,1.305,1.993,1.933,0.405,5.819,8.702,6.855,0.864,8.249,0.284,1.096,0.683,2.569,5.38,2.972,4.213,1.071,4.115,6.856,3.028,0.037,0.483,7.853,0.429,3.768,9.899,7.788,6.502,0.31,9.705,3.178,0.902,7.488,1.784,0.74,8.309,3.487,6.347,0.484,8.924,7.545,0.633,3.294,0.174,4.043,0.537,1.638,1.716,1.412,2.428,0.243,1.301,2.387,1.296,3.453,0.144,0.343,2.236,7.205,4.646,1.346,1.42,0.3,1.191,0.816,0.703,2.959,2.744,2.734,9.382,9.493,0.354,6.831,0.124,5.575,2.523,8.596,0.413,4.62,0.512,0.238,1.134,0.512,0.863,1.321,2.612,1.908,4.349,2.296,5.993,9.063,5.036,0.83,4.681,3.51,2.355,4.274,1.714,2.891,5.501,3.261,8.566,0.52,2.229,1.867,2.417,2.198,6.42,2.004,3.616,5.67,0.188,6.709,5.291,3.256,8.384,5.61,8.026,3.04,3.308,8.828,2.45,2.132,5.017,0.138,1.192,1.833,3.897,1.085,6.81,0.648,1.138,7.409,1.214,5.595,5.255,0.076,3.408,9.381,0.192,4.808,0.959,0.205,0.432,6.197,1.444,2.376,8.393,0.17,3.29,3.27,1.617,4.044,0.114,1.81,0.821,1.985,0.912,1.075,1.579,0.724,0.115,4.438,0.627,3.854,7.693,7.455,9.151,0.457,0.463,3.622,1.022,8.311,4.42,1.014,1.231,2.287,1.834,0.284,0.62,1.201,5.8,9.547,2.391,5.131,1.383,6.167,0.267,5.53,6.42,3.563,6.219,0.071,0.122,4.807,0.789,7.839,3.301,0.125,7.334,5.901,1.068,1.24,4.327,7.151,2.076,1.731,3.187,8.273,0.245,8.241,3.856,1.873,2.636,8.689,1.729,3.673,2.036,2.086,2.061,3.873,0.181,0.408,0.965,2.296,8.711,6.658,0.893,0.642,1.609,3.323,2.547,1.463,1.168,0.664,0.818,2.344,0.562,0.394,0.796,5.4,5.047,1.162,5.253,1.653,6.913,3.101,0.557,4.44,8.286,0.582,4.45,2.009,1.45,0.661,1.988,5.71,2.358,2.173,1.819,0.893,5.011,0.164,6.398,6.507,0.929,1.706,6.797,0.451,7.144,8.56,6.804,5.101,6.222,4.722,4.136,0.665,0.774,1.071,0.534,9.245,0.183,1.442,6.814,1.693,0.567,1.745,3.479,4.328,6.359,0.562,3.112,9.055,2.688,0.517,8.634,1.476,6.7,0.664,2.089,5.322,2.107,0.691,8.416,2.655,3.33,4.885,0.703,7.422,7.499,0.406,1.823,6.428,0.932,1.449,0.206,0.855,4.668,3.217,7.519,1.657,0.188,3.641,2.404,8.482,4.06,1.384,6.339,3.507,2.736,1.591,2.965,7.196,6.255,0.663,3.448,1.936,2.02,4.112,0.723,0.089,2.955,0.128,0.318,8.929,0.987,6.757,1.673,6.381,2.923,7.349,4.344,1.836,3.404,5.717,4.699,2.243,2.09,6.838,0.963,3.965,2.002,3.538,8.877,8.731,8.324,0.295,8.837,0.196,1.544,1.348,0.248,3.071,4.592,6.038,3.338,3.176,1.135,4.397,3.851,8.832,0.143,4.816,1.199,6.465,3.986,4.955,5.777,3.903,6.663,1.475,5.919,3.482,0.605,1.923,1.863,0.621,1.306,2.117,4.865,0.132,0.854,8.329,0.412,0.423,4.437,5.533,2.12,2.778,1.251,0.928,6.647,1.024,0.187,2.178,0.259,1.618,3.717,4.336,2.673,9.139,0.656,4.018,0.236,0.909,2.544,3.94,6.443,0.823,1.34,4.435,4.314,2.215,3.014,7.467,5.217,3.927,6.171,5.996,6.576,4.032,0.305,3.326,0.739,8.133,1.029,6.087,0.683,0.129,0.618,1.245,1.355,1.794,0.108,2.457,1.987,5.705,2.406,0.574,4.406,0.622,0.514,1.165,4.119,7.416,2.379,0.452,2.609,0.255,1.431,1.033,0.201,1.13,3.2,0.487,6.027,2.043,7.296,2.101,4.569,0.172,5.111,0.936,6.648,6.982,1.985,3.081,4.64,2.434,1.638,0.548,4.311,3.604,0.253,0.668,9.53,1.253,3.445,0.66,2.81,2.369,9.143,2.291,4.785,5.211,9.036,2.334,3.768,1.876,5.765,0.31,1.002,7.916,1.586,9.034,5.404,0.157,0.582,4.347,7.629,2.138,1.272,1.193,0.438,8.363,3.513,3.656,8.432,5.566,0.141,0.832,0.537,2.731,2.283,1.623,1.701,3.467,0.543,1.827,0.175,6.816,4.204,3.212,3.362,0.183,2.91,1.298,0.413,5.014,2.144,1.954,3.904,2.156,0.973,0.264,9.17,0.536,1.344,7.071,2.121,3.84,0.838,1.003,0.31,0.504,7.36,1.809,7.225,3.151,5.162,2.92,0.594,8.52,3.494,0.147,0.918,8.986,0.689,1.956,0.307,6.339,1.704,0.942,0.239,1.313,1.447,0.171,4.599,2.772,0.719,2.821,3.38,2.717,3.987,1.791,0.67,1.988,0.387,2.486,3.086,1.086,1.887,0.657,0.236,8.512,8.037,2.567,0.084,1.971,0.822,0.971,1.298,1.613,5.959,9.829,6.536,3.903,3.442,1.992,1.189,0.497,8.004,7.489,5.91,2.315,0.857,6.302,2.03,9.234,6.73,5.556,1.353,4.271,2.794,5.613,8.509,7.144,4.829,7.931,3.018,2.46,0.121,4.642,2.858,3.657,3.236,3.888,0.942,3.697,1.713,0.924,6.616,2.584,5.028,3.418,1.594,3.646,1.083,3.043,3.945,4.559,5.607,6.466,0.846,0.277,6.752,2.258,2.675,0.179,3.358,1.243,2.764,3.133,8.572,0.247,0.341,1.55,2.329,2.471,4.591,7.527,6.895,0.419,9.371,1.696,0.197,0.487,1.31,0.559,4.456,7.675,0.726,6.601,5.958,7.318,1.209,0.726,5.926,1.372,2.123,3.049,4.467,0.288,1.108,0.603,4.983,4.717,3.464,0.314,0.371,8.779,0.082,5.208,7.19,5.656,8.516,9.656,0.15,5.856,0.265,0.854,4.188,2.654,6.912,6.367,1.97,2.201,3.042,2.11,1.901,8.29,1.218,0.852,0.109,9.18,5.224,0.458,0.315,1.207,2.613,1.73,5.581,5.296,5.374,7.349,4.186,3.375,7.154,6.333,2.746,4.678,1.839,0.159,1.489,2.064,9.174,2.272,0.046,4.033,7.365,4.348,1.686,3.648,0.927,1.761,4.055,4.154,7.978,2.891,2.911,2.818,1.516,0.607,1.483,1.819,5.539,5.819,8.306,3.617,1.751,0.713,1.476,0.768,0.129,1.103,3.581,1.019,6.93,1.97,0.878,2.729,2.833,4.212,2.039,4.689,0.561,0.95,2.802,0.522,4.675,0.773,0.1,5.85,6.222,1.771,0.183,4.975,0.822,0.224,1.158,4.462,0.975,4.196,2.455,4.323,0.699,4.991,2.063,1.908,8.535,0.587,3.799,2.172,0.242,1.724,1.014,6.264,3.461,8.334,7.446,5.726,1.247,1.705,0.894,3.361,2.435,0.433,1.398,1.199,0.242,0.476,0.546,2.899,0.337,0.339,1.358,3.22,1.087,5.202,0.638,2.731,4.57,5.125,3.545,4.563,3.142,0.659,3.347,0.068,5.107,5.6,8.97,7.637,6.171,5.47,5.302,1.513,7.534,0.185,0.807,1.437,0.329,3.8,6.92,7.243,9.078,0.519,5.586,4.067,4.258,3.193,0.875,9.048,0.082,2.255,2.368,3.776,8.384,5.101,0.246,1.203,0.924,1.695,9.058,2.045,5.648,1.884,2.388,4.783,0.444,4.653,5.884,4.904,1.413,1.698,9.941,3.278,5.066,2.204,0.446,0.712,3.641,2.743,4.247,1.164,0.992,7.742,2.152,7.434,4.051,0.974,3.175,6.328,6.573,1.529,4.97,3.904,2.929,1.019,1.958,5.266,0.062,5.593,0.705,3.098,0.094,2.43,0.552,2.446,0.465,4.142,0.354,0.796,0.277,5.842,2.026,5.949,3.301,7.304,0.378,6.861,0.424,3.144,3.252,2.282,0.76,3.401,3.877,4.531,2.906,0.565,6.488,6.899,3.147,1.212,0.174,0.596,4.325,1.992,8.375,0.491,5.653,7.146,1.707,0.342,6.47,6.586,2.27,6.41,0.947,4.302,4.593,3.728,5.902,0.71,1.527,3.984,1.44,4.101,0.37,4.984,0.917,0.82,8.752,1.959,2.048,0.351,2.209,2.074,0.577,1.702,9.031,4.474,1.742,0.243,1.264,4.087,4.909,0.975,1.711,0.266,5.471,1.727,7.797,2.599,8.598,8.312,0.335,0.209,1.409,4.967,2.126,0.776,7.933,0.267,0.511,5.42,3.716,8.866,1.199,8.265,3.544,7.428,4.895,3.886,5.215,0.549,3.119,3.038,3.928,2.266,6.329,3.728,0.505,0.558,3.817,3.081,3.474,1.574,8.208,1.745,1.24,4.54,5.957,1.754,3.404,0.744,3.76,4.875,3.893,0.513,0.162,0.762,8.166,0.191,0.308,7.934,5.068,6.271,5.302,0.154,3.436,1.774,2.992,4.693,0.437,0.092,0.589,3.955,0.496,2.931,2.032,4.04,8.237,1.956,2.945,8.137,5.738,2.81,4.77,1.05,4.092,6.694,4.13,5.7,5.271,2.686,0.264,9.029,5.585,5.979,1.966,1.465,2.365,1.693,0.417,7.605,3.709,0.293,6.587,7.586,3.239,4.094,8.428,2.258,1.439,7.148,0.499,4.048,2.177,6.054,5.93,2.747,1.805,2.389,1.569,2.944,3.676,5.292,0.914,2.23,0.528,7.406,0.899,0.567,3.806,0.745,5.197,2.473,1.452,0.441,1.283,3.964,3.365,1.503,9.349,0.673,1.787,3.291,0.544,0.51,0.958,6.056,0.227,6.179,3.364,0.461,0.678,0.99,0.931,0.137,0.377,8.409,0.56,0.825,0.143,0.337,0.861,2.219,3.59,5.296,0.303,1.843,0.882,7.274,1.98,4.545,0.333,7.43,5.525,1.995,3.595,1.468,3.684,5.959,1.055,6.877,2.675,0.492,2.226,0.194,1.095,4.459,1.308,0.657,0.91,2.559,3.021,0.53,7.74,6.484,3.757,6.558,4.837,3.831,6.849,6.681,2.045,8.393,0.837,2.008,4.14,0.209,6.606,0.208,3.116,0.485,6.772,0.687,3.076,5.331,1.865,2.383,8.348,2.385,2.643,0.111,8.826,6.778,0.08,9.058,0.262,8.736,6.41,4.464,1.09,0.231,0.551,3.43,0.611,1.96,0.068,8.947,0.484,3.735,0.151,6.228,7.737,0.931,6.082,0.664,5.021,5.77,6.583,4.169,1.244,0.417,1.739,7.446,0.406,1.962,0.476,1.168,4.345,7.248,8.254,5.319,0.828,3.062,9.361,5.784,2.463,0.392,1.681,3.026,4.169,0.947,2.148,6.933,2.214,9.6,3.075,0.383,4.532,2.924,8.982,4.786,4.359,2.485,1.468,8.03,1.686,5.421,0.335,2.915,2.422,0.147,2.605,3.284,8.852,0.605,0.894,1.983,1.288,4.65,2.712,9.704,4.633,0.984,4.74,0.589,0.903,3.954,7.427,0.251,2.243,1.722,4.987,0.513,1.502,6.796,5.177,3.59,2.208,2.83,2.747,1.555,8.996,0.489,0.633,3.273,8.094,4.761,0.322,3.137,7.108,4.522,3.242,0.295,1.26,9.459,6.299,2.118,5.091,8.387,0.221,0.218,1.351,1.892,8.825,0.479,0.702,1.287,2.369,3.023,2.493,1.176,1.123,3.712,0.121,8.415,1.085,0.619,2.856,0.569,4.389,2.086,0.969,5.917,6.142,6.697,4.807,0.201,7.642,7.959,0.823,5.289,1.325,1.001,3.439,1,1.257,0.362,2.045,8.149,1.942,0.52,4.343,0.382,4.594,8.89,4.474,5.044,0.47,5.208,2.151,3.275,9.717,2.429,8.989,3.952,4.76,1.742,1.049,6.369,1.451,0.133,2.174,0.274,7.472,2.009,2.552,4.983,2.806,4.553,1.211,7.819,0.628,2.227,6.216,0.226,9.598,2.024,0.077,5.838,1.563,4.478,0.224,5.684,8.948,5.759,8.19,1.279,0.702,2.574,1.432,1.694,3.255,3.695,4.345,0.3,0.578,5.395,3.494,8.623,1.453,2.177,3.52,4.409,0.445,8.304,5.739,0.845,3.54,7.698,1.968,3.198,4.417,0.915,0.117,0.124,9.315,0.037,5.149,1.702,5.771,0.48,0.606,1.536,2.521,4.945,0.565,3.697,0.162,8.499,9.203,3.345,1.383,8.64,8.01,6.288,7.418,1.784,1.305,9.119,5.725,1.911,5.954,0.101,2.785,1.135,2.558,4.909,0.099,0.173,6.324,1.872,1.495,2.899,1.68,1.004,6.905,0.46,8.098,5.814,7.963,4.487,0.919,3.653,0.404,0.473,4.448,0.417,5.102,2.475,3.696,1.458,0.591,0.395,1.297,5.321,1.915,0.911,5.758,2.82,5.396,8.727,4.972,2.196,1.142,5.908,0.432,2.594,2.181,6.262,3.138,2.617,7.302,1.826,3.225,0.291,0.945,7.794,3.865,0.208,8.902,1.9,2.319,3.722,2.032,1.545,0.992,6.705,2.696,0.689,3.184,2.432,1.083,6.656,6.229,3.998,0.947,2.294,4.833,0.988,1.7,3.132,1.977,5.497,0.196,3.58,1.746,6.218,1.008,2.25,2.375,2.606,2.176,1.259,5.568,5.764,0.749,5.414,2.215,4.277,2.468,3.99,2.173,0.45,6.752,1.238,1.408,3.044,1.479,0.564,7.168,0.701,4.076,0.642,9.625,6.383,0.659,1.152,2.781,0.708,0.49,0.849,4.916,3.63,2.487,0.196,6.055,8.947,0.582,0.111,1.255,6.261,2.103,5,4.969,2.353,2.72,0.294,4.348,1.418,8.305,6.547,4.134,1.742,0.168,0.174,5.567,0.408,1.201,5.037,1.931,5.075,0.082,0.938,0.091,0.57,2.808,0.733,5.377,3.829,2.374,3.786,1.656,2.421,1.941,2.196,0.77,8.602,5.983,1.533,1.96,9.461,0.526,8.667,0.804,1.056,0.558,2.833,0.407,0.056,2.121,0.943,9.033,9.065,9.57,0.672,3.73,7.612,1.304,4.396,0.256,1.091,3.869,1.174,3.378,1.526,2.161,1.488,5.505,4.727,1.673,4.521,4.286,1.566,5.675,4.562,2.898,3.088,2.753,0.656,0.366,5.133,3.948,3.202,2.522,5.446,0.809,5.829,2.961,0.145,0.676,1.928,1.812,9.012,0.962,7.516,9.567,0.891,2.33,0.85,4.297,8.225,9.192,9.481,3.642,0.675,6.61,5.337,3.335,0.413,3.123,1.993,6.671,4.688,3.369,3.76,0.138,9.319,5.618,0.198,1.784,1.101,2.194,0.654,4.29,2.327,7.897,3.685,5.415,0.102,0.403,1.606,9.736,6.693,0.133,6.559,6.8,1.22,6.643,4.44,6.043,0.739,3.571,0.882,1.794,2.566,0.881,6.392,1.372,1.031,0.779,0.175,0.946,7.691,3.455,2.412,5.951,1.155,4.917,4.398,1.419,3.027,9.324,9.084,1.92,0.51,1.762,0.807,2.881,8.001,8.339,4.008,5.405,2.013,1.824,1.28,1.031,8.355,0.546,1.686,0.507,0.543,4.282,0.322,2.807,1.894,5.128,5.168,0.282,1.311,1.558,0.925,3.029,1.959,4.417,2.532,8.845,5.596,0.432,0.225,3.012,0.272,1.262,2.421,0.903,9.365,4.564,6.685,2.687,9.349,0.94,1.835,0.63,6.935,3.121,1.513,1.813,2.842,7.485,1.104,3.07,8.457,4.643,9.742,8.335,3.569,3.322,1.259,3.055,2.644,0.172,3.084,4.567,6.59,7.593,1.299,1.903,3.903,5.132,0.561,7.869,6.997,2.63,1.938,0.294,0.262,0.705,0.961,0.645,1.92,0.941,1,2.07,1.075,0.366,3.586,3.452,7.502,1.951,1.317,4.374,6.793,1.585,0.735,7.273,0.19,2.469,0.166,9.986,0.276,1.75,2.689,7.631,7.121,1.405,1.619,7.599,5.623,1.828,4.584,0.282,0.538,1.477,7.532,7.397,2.077,0.345,3.084,0.687,5.836,2.137,3.81,0.937,6.859,0.746,0.468,0.504,8.315,6.67,6.739,1.979,0.381,2.494,7.078,3.524,0.315,0.284,1.637,5.276,9.011,2.881,7.643,0.706,0.2,3.209,0.512,3.652,0.858,3.704,0.208,0.419,4.619,4.408,0.389,7.222,5.372,0.738,4.518,6.874,5.793,5.443,1.13,2.302,4.299,7.69,4.277,2.492,1.154,0.991,0.2,0.135,1.752,4.509,1.633,0.47,7.579,3.387,2.455,4.766,0.72,7.9,3.927,0.846,0.178,0.723,2.267,5.218,3.619,0.717,0.174,4.112,0.634,4.043,2.1,4.096,0.858,0.653,2.442,0.151,5.338,0.952,2.704,8.416,0.76,2.145,0.105,3.058,4.352,0.787,6.794,8.21,1.442,3.008,6.576,0.99,6.267,5.769,0.928,0.193,2.532,3.557,2.011,0.192,8.723,0.434,0.287,1.777,1.009,7.975,2.3,8.944,0.478,5.304,4.607,0.116,5.475,2.025,0.218,2.213,4.907,4.966,0.155,0.346,3.444,1.617,7.698,2.301,2.907,2.683,0.886,7.775,1.146,0.205,6.934,2.264,0.112,9.472,6.048,1.139,3.199,2.846,1.395,3.185,0.271,6.107,0.561,3.503,2.344,0.513,3.748,1.886,0.293,3.414,6.963,0.215,6.239,1.642,1.227,0.351,0.508,1.299,4.662,0.69,0.567,5.749,4.036,5.902,6.5,2.195,1.994,3.5,0.709,5.593,6.879,6.569,0.731,4.225,6.288,2.228,1.085,5.18,2.886,0.191,0.508,5.183,0.072,3.318,3.383,0.56,5.952,0.166,0.23,5.343,3.817,2.128,1.192,0.58,9.162,2.26,1.79,5.356,0.926,0.226,1.953,0.204,2.793,4.033,7.464,7.77,0.935,8.948,7.047,7.435,5.477,3.434,9.432,2.126,5.574,7.115,3.795,8.334,8.246,1.759,5.255,0.484,1.052,8.066,1.517,1.513,1.945,5.599,6.541,0.168,4.079,0.444,0.484,1.79,0.644,4.407,0.54,1.186,3.902,7.587,6.482,4.071,1.845,0.206,0.286,4.293,4.317,5.907,0.25,9.661,7.132,0.928,6.466,0.532,1.136,8.594,0.677,0.656,9.551,6.487,0.644,1.554,1.197,5.716,1.981,1.501,1.909,1.559,0.859,5.075,0.093,8.774,2.344,0.232,4.644,1.513,3.007,0.612,8.653,0.315,5.917,7.565,3.731,7.082,3.664,0.719,5.669,0.289,0.445,2.039,5.525,0.064,2.175,2.573,2.151,6.728,0.9,4.642,8.332,4.488,0.498,8.033,4.293,5.293,4.453,0.774,5.738,1.395,6.457,0.238,0.212,1.996,3.261,5.407,9.478,6.21,9.339,2.04,1.281,2.283,0.477,2.021,3.325,2.843,0.436,0.197,0.128,3.514,4.431,1.343,0.134,1.812,1.618,3.703,5.397,1.015,5.991,9.21,1.662,0.269,0.309,9.097,0.165,6.702,3.167,0.38,5.346,1.022,1.591,3.767,4.478,0.553,0.645,7.611,5.451,0.816,0.222,4.066,0.256,6.447,1.545,0.539,3.926,3.942,5.171,5.6,6.188,0.253,6.395,1.161,0.164,2.904,0.983,0.948,0.465,0.72,2.579,0.911,1.444,1.752,0.204,0.941,3.366,2.031,1.597,5.544,2.005,4.712,7.278,5.959,8.531,0.729,7.91,3.757,1.966,0.308,8.788,0.78,0.13,5.377,1.264,4.638,5.3,2.63,7.761,0.619,1.202,0.278,2.483,0.739,4.041,3.362,1.096,0.945,3.899,1.316,5.993,0.758,6.857,9.171,5.089,0.478,1.818,1.813,3.909,1.034,0.875,7.675,6.016,0.635,0.138,4.385,0.329,1.334,4.879,0.254,0.227,0.538,3.298,6.707,2.912,6.045,2.376,0.392,0.444,5.613,0.597,2.658,4.149,2.66,9.74,4.27,6.611,7.229,3.771,4.04,4.098,0.724,5.408,4.583,8.047,1.869,0.309,8.995,0.193,4.401,0.26,2.708,3.015,5.919,3.345,1.868,1.742,7.32,5.17,2.217,5.154,3.56,2.702,2.824,8.935,1.373,2.129,4.939,1.1,7.839,1.395,7.388,0.222,0.272,1.962,1.607,1.41,5.958,2.404,0.754,8.402,0.161,6.182,2.324,0.354,1.645,1.605,6.923,1.57,2.155,2.146,0.482,7.112,0.072,8.089,0.416,3.719,0.341,1.415,2.501,0.381,5.638,2.412,0.255,5.11,1.188,5.851,2.053,5.41,1.174,8.576,1.245,4.99,0.143,1.532,0.344,7.474,7.365,0.191,0.257,0.182,5.838,1.283,2.48,4.124,5.518,4.255,1.508,1.386,6,5.135,0.094,3.608,0.376,1.957,3.567,7.709,1.815,7.117,3.15,0.304,1.096,2.652,3.258,4.317,0.45,1.595,0.925,8.275,7.862,7.621,7.774,7.439,4.846,0.236,7.27,3.775,4.983,5.011,1.056,5.605,0.38,4.118,0.285,8.953,1.976,8.419,4.071,6.466,0.615,8.853,0.86,6.497,0.805,6.11,6.672,2.164,0.978,3.544,2.187,7.022,2.394,2.839,2.52,1.05,0.713,1.357,7.591,2.053,0.273,0.161,5.151,5.967,0.249,7.463,1.721,2.905,1.518,3.982,6.427,1.609,0.672,4.169,0.52,1.422,1.79,0.616,4.417,0.423,2.47,2.417,0.243,0.654,6.774,3.653,0.85,5.879,2.044,7.373,5.331,6.073,0.287,0.204,0.856,2.495,0.299,6.473,2.641,1.91,2.805,0.603,1.961,0.35,1.105,8.897,5.934,0.598,6.145,3.498,0.8,5.855,2.576,1.518,3.33,5.516,9.058,2.983,0.549,0.859,8.009,1.623,1.25,2.383,7.049,9.007,0.657,1.435,0.393,5.845,8.716,4.572,8.322,0.43,0.789,0.175,0.957,1.724,1.961,6.126,3.231,1.202,0.181,3.59,0.156,1.216,4.416,1.321,3.691,0.389,1.404,2.927,6.206,0.498,2.174,0.465,0.063,4.736,7.715,0.762,4.681,0.961,4.399,9.046,0.558,0.249,3.884,2.751,1.695,7.197,0.231,3.289,3.795,4.677,2.948,3.915,7.641,8.227,2.584,0.799,7.046,7.166,3.841,4.784,7.867,2.463,4.865,1.265,7.49,3.47,1.973,0.806,2.071,0.451,1.272,3.88,5.232,4.827,7.808,2.187,1.672,9.046,4.318,1.137,4.655,6.904,0.318,2.664,4.885,0.3,1.255,5.068,6.568,0.129,4.436,0.254,6.404,1.762,2.818,2.571,6.68,0.178,2.028,0.395,8.165,5.694,1.995,5.333,1.576,1.655,4.664,1.587,0.814,0.733,0.179,0.633,0.238,0.127,3.832,8.286,5.22,0.079,7.17,5.588,8.917,0.548,9.242,0.606,0.481,4.488,1.973,9.625,4.127,3.095,5.035,0.402,8.302,4.661,6.206,5.812,1.567,0.958,0.359,0.942,5.728,9.267,0.383,5.392,1.65,4.26,1.471,7.835,3.523,0.816,1.31,8.72,3.31,2.948,3.352,1.672,5.097,8.195,0.389,0.483,1.337,3.933,9.187,1.609,3.278,0.781,1.175,4.76,7.15,6.835,3.31,4.149,1.721,2.484,3.264,0.718,7.061,4.737,9.428,0.164,0.446,0.819,0.591,0.156,1.962,0.371,0.686,6.838,2.861,3.315,2.254,0.587,0.544,1.903,0.622,8.699,1.341,0.634,6.964,0.881,6.092,0.301,3.825,3.257,0.669,3.05,0.558,8.341,0.328,2.602,8.093,0.477,0.093,1.838,7.462,5.515,1.599,2.306,1.08,0.814,1.271,0.07,1.078,2.461,2.002,0.32,0.245,1.308,0.485,3.361,1.097,1.99,2.223,2.989,2.129,2.698,0.199,2.784,7.13,0.061,1.74,7.783,0.18,3.87,3.555,3.745,3.496,7.583,4.823,3.79,0.412,1.746,1.578,6.645,0.84,1.202,3.463,2.977,4.557,1.187,0.126,3.316,8.88,0.216,4.382,7.747,7.624,1.551,0.21,0.68,0.083,2.279,0.326,2.877,0.521,6.457,0.912,0.36,2.2,4.034,5.665,1.572,4.037,4.731,3.894,1.173,4.314,2.269,0.559,0.387,2.779,0.72,2.706,1.665,3.286,0.763,1.498,4.511,7.395,2.06,4.823,5.404,1.339,2.785,1.139,6.64,1.516,3.083,0.184,4.242,1.359,8.185,3.875,3.705,2.886,0.594,2.338,9.203,2.649,0.159,1.843,1.425,2.871,6.264,7.842,0.774,1.127,1.815,1.394,2.318,1.628,2.408,5.342,0.27,3.673,3.77,0.717,1.261,0.852,1.075,3.049,5.835,2.385,2.575,1.529,0.202,7.882,6.804,8.689,0.305,9.474,4.344,4.923,0.431,8.47,3.758,2.104,1.561,0.18,4.568,1.551,7.782,6.556,8.534,3.094,8.547,2.048,4.855,9.547,7.397,0.182,8.514,0.483,4.039,5.119,1.709,6.221,1.086,2.596,5.26,7.622,3.13,3.315,5.813,5.361,2.659,2.857,0.17,4.81,0.53,0.201,0.944,0.626,7.328,7.283,7.208,2.012,0.037,0.772,0.328,2.104,1.635,2.713,1.483,1.603,4.366,7.382,0.895,4.978,3.426,3.628,5.158,4.023,2.163,9.354,1.227,2.661,1.804,0.857,2.55,5.633,6.535,7.31,0.913,1.095,3.283,0.895,0.166,4.765,2.864,0.685,3.975,2.675,1.173,1.127,5.36,0.357,0.436,0.671,7.236,6.728,2.101,3.036,0.341,0.203,7.088,1.661,1.71,7.978,0.552,8.309,1.513,1.566,1.575,4.508,2.342,0.053,8.044,0.195,1.178,0.387,1.959,3.624,1.677,3.228,0.821,6.171,0.504,0.622,0.154,0.924,0.17,0.336,3.254,1.017,5.854,2.208,4.482,8.424,4.274,3.353,8.677,0.346,1.91,7.649,6.241,5.481,2.045,2.393,7.648,8.778,8.613,1.06,7.104,2.587,2.93,0.179,0.206,0.948,3.347,9.65,6.802,0.27,1.597,0.608,5.346,0.328,0.219,4.136,4.637,3.599,1.163,6.718,7.48,5.377,1.183,0.838,7.697,5.222,0.45,0.354,6.248,2.974,0.419,6.155,0.743,6.972,2.179,0.691,5.338,3.698,1.547,0.172,3.31,7.012,8.065,0.899,1.367,5.433,3.224,3.703,9.354,1.033,7.78,3.347,0.653,0.242,2.2,0.403,0.14,3.327,0.14,7.083,1.349,0.488,2.943,3.186,2.283,2.446,1.758,1.268,7.802,1.665,6.205,2.851,1.952,0.507,8.03,6.119,0.939,3.631,4.772,3.875,3.948,8.706,6.748,0.335,1.205,8.333,0.787,0.521,6.535,0.373,1.439,3.766,2.999,0.457,2.637,1.39,0.613,0.439,4.06,7.818,0.627,4.297,4.824,8.064,0.88,0.116,0.675,2.205,2.634,8.39,6.981,5.336,7.618,0.772,0.691,2.542,0.67,7.956,1.08,0.633,8.237,3.11,0.583,2.415,8.838,7.708,7.016,0.14,9.375,3.561,3.624,8.157,3.619,0.541,2.644,6.008,3.804,3.325,1.375,3.722,2.075,6.167,1.331,3.816,2.685,3.688,4.312,7.389,3.076,3.106,3.214,0.644,1.809,0.825,3.135,1.051,1.77,3.056,0.047,6.975,6.867,0.269,3.126,0.427,2.583,2.286,4.092,8.039,5.886,3.993,2.912,5.287,2.756,8.917,4.025,5.694,3.434,0.38,3.404,0.334,8.887,6.642,2.448,2.43,4.005,2.408,3.549,9.155,2.443,2.615,1.084,0.359,3.827,6.488,1.851,2.011,1.07,5.123,9.688,1.48,0.877,2.41,3.015,1.21,6.211,8.918,7.01,8.98,1.967,5.065,7.637,0.381,1.688,0.26,0.28,6.438,1.938,3.7,7.315,8.165,0.123,1.304,7.824,7.722,3.484,4.237,0.238,0.237,0.178,0.129,1.566,7.355,5.874,3.706,0.684,0.493,7.516,1.151,0.174,2.821,3.255,5.612,6.558,1.052,0.261,1.985,1.067,1.091,1.695,0.295,0.919,5.537,2.043,1.463,1.145,5.668,1.77,0.679,5.872,2.834,2.369,9.73,1.033,6.664,9.3,7.762,7.919,0.42,0.879,3.49,9.164,3.326,4.004,2.75,1.953,2.99,1.687,1.426,0.228,4.448,8.097,2.804,5.652,6.378,3.016,6.778,5.606,2.921,4.775,0.273,6.645,5.334,0.218,1.999,5.866,1.155,0.301,7.347,0.872,5.889,7.938,0.35,0.558,0.341,0.978,0.178,4.025,2.129,1.426,0.395,7.322,0.693,1.977,4.682,4.733,3.424,1.355,1.621,1.994,0.525,1.063,3.381,4.6,0.519,0.393,3.504,7.256,0.373,0.426,0.98,6.418,2.03,8.665,1.826,1.589,4.251,0.406,0.191,0.859,3.314,0.89,3.147,7.022,9.13,4.795,2.476,1.508,4.172,9.561,4.527,1.752,2.097,4.762,4.033,2.927,2.304,1.816,5.033,7.511,0.32,3.851,2.118,5.784,6.78,5.451,0.924,1.517,6.819,2.858,4.994,8.597,0.634,8.438,2.626,6.858,1.978,0.584,9.281,1.846,4.734,0.741,7.242,0.619,4.47,2.245,9.13,4.964,0.898,1.08,1.762,9.26,5.956,3.247,7.367,1.761,1.225,0.882,3.481,6.518,2.835,1.699,0.192,1.139,7.973,0.696,8.014,0.262,0.143,0.229,3.881,2.975,6.128,3.068,1.567,4.326,1.786,0.202,1.891,0.566,7.065,8.42,2.62,9.245,1.241,0.69,5.612,6.424,0.1,6.744,7.871,1.724,3.493,3.772,2.716,6.869,0.693,4.202,0.58,7.216,2.008,2.218,4.685,0.276,1.421,3.783,0.531,0.085,8.031,8.398,0.982,7.519,0.494,4.867,2.507,5.361,2.199,2.316,0.726,5.096,3.782,0.42,3.521,0.547,5.858,0.235,3.091,2.411,7.956,8.785,1.013,3.826,1.768,5.277,0.824,4.62,2.065,3.638,1.87,4.628,1.113,1.879,7.121,2.146,1.853,1.644,0.211,2.346,6.39,1.064,1.461,8.258,2.532,0.528,2.463,1.983,1.671,1.805,4.033,7.794,2.931,2.829,0.952,7.666,0.762,0.291,3.714,0.518,1.87,1.956,7.181,4.726,0.291,3.524,0.227,2.799,0.632,2.386,0.466,0.868,3.825,1.7,6.925,6.379,2.757,1.874,8.882,2.41,0.264,1.389,3.886,1.627,1.617,2.103,7.781,5.161,1.1,0.43,1.511,1.768,0.176,0.126,6.382,3.037,0.502,1.151,1.091,1.195,0.622,3.879,0.186,3.465,1.557,5.927,1.265,1.401,6.783,0.148,3.101,6.548,5.158,1.552,0.858,3.103,3.211,3.743,6.671,2.338,6.771,6.284,4.64,2.6,0.111,0.415,2.22,3.287,3.9,2.884,3.653,0.863,1.259,2.02,2.774,9.148,6.605,4.131,1.511,6.734,4.55,0.276,1.635,2.044,1.477,7.848,7.53,3.668,0.466,0.385,4.271,0.946,1.498,0.037,3.193,1.123,0.891,8.06,2.713,0.422,3.665,0.377,4.558,1.232,0.503,1.962,4.841,0.168,2.316,7.615,0.784,2.05,1.881,0.229,0.509,4.028,0.885,0.437,0.134,0.837,1.055,2.597,2.234,2.033,5.862,2.885,3.687,0.504,0.228,1.378,0.361,9.401,4.687,0.969,0.548,0.239,2.9,0.654,0.183,8.504,5.111,4.707,7.374,2.563,2.432,9.361,2.051,7.351,2.871,4.734,2.957,6.619,0.569,1.226,3.979,0.176,3.735,4.892,5.699,4.457,0.905,1.156,0.598,2.34,5.99,0.224,2.767,5.225,5.604,5.826,0.779,1.988,4.31,0.432,0.83,8.195,0.037,5.938,1.829,2.05,8.228,0.919,2.344,1.556,4.403,4.266,0.089,1.507,1.879,0.195,2.472,3.442,0.636,0.144,7.211,1.397,2.8,1.837,8.486,2.07,0.609,0.276,0.392,6.498,1.538,6.855,3.775,9.136,8.855,6.897,4.194,5.722,0.49,7.632,7.886,3.727,4.08,4.167,8.056,5.791,1.15,6.432,6.204,1.982,6.604,7.477,8.821,0.583,8.706,0.877,0.264,0.451,6.669,5.695,4.781,5.385,5.97,5.347,3.067,1.403,5.618,3.241,1.56,8.208,4.645,5.756,2.874,5.581,8.626,0.248,9.138,0.547,5.173,0.215,7.308,4.519,0.101,4.829,1.22,2.331,3.95,0.398,0.534,1.595,7.737,2.806,3.148,3.233,3.251,8.307,8.301,0.108,5.868,8.949,0.833,4.6,0.856,3.59,4.814,1.097,6.475,4.479,3.778,0.258,7.775,3.492,1.29,2.102,6.756,5.531,1.489,7.644,2.689,2.888,1.59,7.278,1.101,2.756,0.625,4.941,2.329,8.83,0.449,0.34,0.518,6.789,1.594,0.068,2.459,4.894,1.125,5.106,1.391,3.548,0.101,1.413,8.77,6.83,5.553,2.127,0.394,3.003,0.357,2.852,0.184,4.831,7.652,0.155,2.197,7.662,6.961,2.277,8.842,0.923,2.384,3.604,8.841,2.289,3.966,0.31,8.26,0.369,0.953,8.54,2.639,3.331,5.5,0.994,1.754,1.223,0.08,2.393,2.567,0.252,1.139,0.273,2.539,0.315,1.236,1.527,9.842,6.732,1.118,6.415,0.398,1.733,0.255,0.185,3.568,0.342,1.63,1.209,5.465,0.438,0.159,6.073,2.393,2.381,3.209,4.12,0.044,2.565,2.942,0.111,6.591,0.932,2.91,8.841,6.066,0.442,2.644,5.455,6.17,3.263,1.057,2.149,8.674,2.618,0.255,1.302,0.34,3.832,0.953,0.752,8.015,0.851,0.14,1.7,0.749,7.476,2.852,7.628,6.109,0.128,2.361,2.944,4.639,3.162,7.514,0.947,5.21,9.811,1.067,2.88,0.701,1.052,4.268,1.765,1.496,2.571,0.383,4.798,5.384,4.53,4.193,1.67,1.927,0.208,6.979,0.44,1.182,5.051,6.326,0.877,8.986,2.955,0.171,0.603,9.177,7.333,1.452,8.701,9.752,9.528,3.309,2.343,9.375,0.501,6.426,3.146,0.167,2.688,2.418,4.691,2.785,1.241,2.753,0.282,1.538,1.12,5.869,4.84,0.579,1.87,6.546,0.663,1.777,6.081,5.795,4.928,0.612,7.366,2.252,1.703,1.347,3.472,6.684,0.067,4.146,7.438,1.118,0.141,2.763,1.145,4.746,1.808,3.48,3.126,0.708,2.314,1.336,8.348,2.693,3.751,0.292,0.773,0.221,5.479,2.363,5.319,0.499,0.602,2.117,5.521,9.068,5.77,0.924,2.144,0.625,2.845,2.392,8.632,0.844,8.581,7.904,1.668,3.521,0.143,8.045,9.27,7.014,5.536,1.827,5.919,2.862,1.27,1.185,2.982,1.854,1.73,0.534,5.278,2.084,1.382,6.025,0.658,1.933,4.58,1.626,0.525,1.993,1.408,5.935,6.658,6.551,1.557,0.248,7.151,5.52,3.641,2.115,5.638,0.448,3.922,6.472,0.177,0.459,2.868,1.142,0.23,5.428,0.507,2.012,8.165,3.083,0.439,1.657,3.577,7.382,4.936,3.893,0.417,3.72,0.387,0.101,3.926,2.874,1.042,4.696,1.815,3.624,0.293,1.056,3.221,0.833,1.635,0.37,0.893,4.264,3.566,0.17,4.989,0.293,2.455,6.948,2.587,7.08,7.025,0.191,3.176,1.359,0.679,1.323,0.776,4.038,6.595,4.965,6.029,0.363,8.6,3.904,4.216,3.132,8.125,0.624,9.001,0.231,0.528,1.195,6.12,4.34,6.476,9.232,0.666,1.067,1.94,4.811,1.179,3.786,2.506,0.906,1.889,4.854,1.524,4.98,8.746,9.176,0.242,1.416,7.326,0.864,1.866,1.37,9.328,1.764,4.409,3.437,1.735,0.976,2.457,1.767,0.456,2.206,1.306,2.998,2.874,0.294,1.856,0.115,1.53,4.159,2.28,2.736,0.838,1.573,0.375,5.82,0.616,5.283,0.581,7.443,4.181,0.136,8.591,7.645,0.185,8.516,3.821,0.869,4.897,0.339,0.287,5.234,5.333,0.616,2.395,5.287,0.29,0.093,1.812,3.757,0.433,4.616,0.438,2.936,9.397,2.786,2.597,0.996,1.241,0.416,0.284,1.627,5.865,3.904,1.009,8.987,8.551,3.898,0.168,0.958,0.235,0.809,5.088,4.764,0.608,6.892,6.483,8.188,1.723,0.274,9.018,6.754,0.652,1.953,6.758,0.258,6.054,6.87,7.778,5.797,1.099,7.563,1.471,4.724,3.326,1.933,2.37,3.639,0.28,2.368,0.102,6.038,2.134,4.32,3.549,3.826,2.11,1.028,1.627,0.533,4.2,0.436,5.932,4.044,1.52,1.22,4.675,6.316,1.068,0.437,5.631,1.784,6.821,3.832,1.681,5.047,3.645,7.444,0.208,5.131,4.483,1.1,0.125,7.468,7.176,2.988,0.455,7.578,0.986,1.318,6.046,0.562,3.249,3.037,3.447,6.803,1.324,1.511,0.573,5.614,0.259,1.857,2.402,9.803,4.26,4.115,1.805,9.108,1.154,9.495,1.674,0.204,0.371,2.843,0.825,2.91,3.701,2.069,0.162,7.281,0.184,1.311,6.48,0.291,0.208,4.502,0.183,8.161,1.601,3.969,5.388,5.006,5.446,7.296,5.868,5.851,0.776,2.77,0.617,3.257,3.535,3.854,2.1,0.433,0.717,9.072,3.469,1.579,5.936,4.037,0.491,0.525,3.646,2.998,0.63,6.709,1.323,4.648,0.322,1.461,2.696,6.857,3.128,5.705,0.851,1.757,0.136,1.924,4.291,3.514,2.464,0.745,3.433,4.753,6.893,9.137,2.959,1.918,1.902,3.265,2.068,7.775,1.376,7.136,2.719,8.187,1.636,2.4,4.063,2.214,0.296,0.613,3.792,4.216,1.299,3.482,4.328,6.167,8.056,1.007,4.068,4.43,2.306,0.367,0.372,1.961,3.779,0.872,7.427,2.163,5.289,0.435,1.537,6.154,6.705,9.605,1.278,3.457,1.892,1.423,4.389,4.858,0.73,2.107,3.423,5.275,2.968,2.939,4.821,1.035,6.378,8.709,1.688,3.408,2.434,1.112,1.647,0.938,6.697,2.681,2.561,2.839,5.843,1.717,8.198,1.106,9.151,0.797,2.662,2.465,1.362,7.8,4.807,0.915,5.46,0.294,1.216,6.627,4.51,3.138,0.144,1.437,5.947,3.398,6.387,3.243,0.828,6.009,1.167,4.843,3.554,5.558,2.179,0.234,1.245,0.426,7.186,0.144,7.125,0.083,0.745,0.441,2.539,0.541,1.051,9.718,0.097,1.062,2.123,5.605,2.831,5.389,0.177,8.62,7.029,1.504,6.874,4.384,4.123,1.264,1.116,4.949,0.246,1.031,0.686,6.699,7.44,2.205,4.868,7.404,0.146,2.405,1.042,1.703,3.599,6.15,3.264,4.055,0.184,3.529,0.849,1.244,6.223,4.881,3.817,7.663,0.814,0.313,0.168,3.547,3.025,0.194,0.369,4.335,0.938,7.917,4.132,3.933,2.342,2.732,3.185,8.184,4.775,0.243,5.196,1.298,7.321,1.365,4.987,7.859,0.381,6.288,0.534,0.221,0.273,3.152,7.548,3.643,9.331,2.935,0.087,0.974,0.31,3.505,0.209,5.374,8.282,1.206,0.282,5.571,0.483,7.219,0.662,0.479,2.577,7.653,0.385,1.655,2.834,0.369,4.744,0.19,1.363,2.785,2.701,4.689,0.264,3.567,9.414,3.486,0.55,0.805,8.312,0.562,8.702,4.348,5.98,0.912,4.301,6.316,5.323,6.846,1.124,2.241,1.865,1.479,6.453,4.958,3.978,4.712,0.513,2.649,0.338,9.267,1.303,5.961,3.147,0.278,7.216,2.024,2.191,1.524,0.707,0.038,9.465,0.416,0.416,0.527,1.075,2.409,8.69,2.188,7.763,1.875,8.768,1.502,3.183,1.621,1.699,0.866,0.228,2.415,1.958,1.398,3.237,2.532,0.213,1.232,1.201,0.256,0.581,5.185,1.377,0.358,0.285,3.63,8.356,4.997,0.53,0.469,6.377,4.201,0.377,8.628,5.72,8.408,2.629,5.638,2.913,0.107,1.97,1.492,3.628,5.013,9.568,0.72,0.591,4.148,0.032,0.445,6.583,0.48,4.438,1.239,2.085,0.825,0.2,3.25,7.98,0.245,0.15,9.747,3.51,7.598,4.694,0.12,3.517,0.939,2.248,8.237,5.203,4.337,6.707,4.028,2.549,4.651,7.843,0.786,0.407,2.527,0.152,2.97,1.243,5.315,8.299,1.029,0.437,5.152,4.649,1.033,2.18,0.394,2.479,4.888,3.317,0.862,4.493,8.218,1.784,2.388,2.671,0.138,7.467,3.677,0.986,1.116,8.999,2.707,2.693,1.036,2.852,6.03,6.921,2.57,9.538,0.811,0.383,0.162,1.895,0.948,5.319,0.982,0.041,6.661,4.931,0.581,3.372,6.52,4.184,7.523,1.975,2.455,1.37,2.534,8.851,2.498,3.973,4.14,4.556,8.799,1.656,1.069,1.272,5.275,1.545,1.575,1.596,0.709,0.735,9.656,1.25,6.194,2.655,0.637,8.214,0.432,0.611,0.522,6.975,1.339,5.834,0.249,0.318,8.912,5.646,2.418,2.871,8.257,3.173,0.647,5.713,0.136,1.284,2.952,1.794,2.244,4.132,1.529,4.703,0.569,2.012,1.198,0.059,8.331,0.795,2.763,0.559,0.564,1.176,3.703,3.686,3.014,1.114,9.437,6.465,5.53,8.923,0.64,0.325,7.374,1.429,1.033,4.156,4.379,9.232,8.667,1.894,8.534,6.366,2.638,7.333,0.146,6.459,3.333,7.174,0.882,2.87,2.993,9.77,1.533,4.062,1.369,1.912,2.53,5.508,3.315,5.461,1.759,0.287,0.233,0.432,5.069,4.731,0.836,0.429,2.197,3.303,0.992,7.857,2.577,4.474,3.252,1.744,3.648,3.39,0.21,0.841,4.064,0.523,6.422,1.685,3.047,5.375,7.393,1.239,0.4,5.221,1.746,0.474,0.854,5.09,5.414,4.684,2.473,6.217,0.33,7.576,0.951,2.283,1.22,4.167,0.199,1.747,0.627,2.051,2.84,0.381,1.972,1.076,0.372,5.261,1.62,3.817,6.91,4.3,7.603,0.798,5.882,1.383,3.539,3.228,1.142,3.019,3.457,0.205,6.227,6.011,1.556,2.718,0.585,0.972,0.415,0.463,0.311,4.533,0.588,8.169,0.08,4.85,2.028,2.994,1.758,7.591,7.886,3.28,3.967,1.27,5.456,1.375,0.956,3.757,4.097,0.262,2.865,8.027,8.263,1.189,1.917,1.588,0.287,2.344,3.453,1.567,0.777,4.272,6.258,8.803,1.419,0.522,1.2,3.817,4.291,4.889,2.873,2.126,2.613,5.099,5.636,7.436,0.062,8.199,2.172,8.29,0.317,8.038,9.198,1.845,2.005,5.664,2.243,1.136,5.307,1.002,3.485,0.275,3.489,0.545,1.908,0.985,3.176,6.547,4.181,4.386,2.499,0.44,0.071,6.403,5.483,1.267,2.338,2.648,2.213,1.931,3.097,4.252,2.232,4.867,4.267,5.335,1.942,3.897,2.56,0.764,1.584,7.802,8.172,2.996,0.613,5.093,0.384,4.273,4.193,6.232,5.114,2.687,6.975,6.38,2.351,0.829,0.468,7.731,0.793,2.421,0.188,6.651,0.213,0.152,1.854,2.281,0.989,6.768,0.674,8.594,0.946,3.554,0.815,2.53,5.05,1.094,5.295,7.746,1.242,1.192,5.177,0.184,6.59,0.782,7.322,5.615,5.557,5.322,2.635,0.606,0.837,0.168,7.168,3.292,2.223,2.137,1.385,5.916,1.637,0.547,4.915,1.455,0.707,6.648,5.768,3.719,0.593,6.375,3.047,5.105,0.817,1.458,2.801,0.809,6.906,2.156,0.999,5.26,0.592,0.386,2.723,0.335,1.468,3.13,1.695,1.72,2.889,2.474,1.276,1.185,0.344,8.169,1.928,3.932,0.258,0.697,6.561,7.472,7.918,5.923,6.621,5.826,7.139,2.565,2.6,4.418,2.876,1.486,5.447,0.516,0.594,4.384,1.672,0.584,2.301,8.045,6.806,5.189,0.202,1.901,3.542,5.62,1.572,1.552,0.825,2.269,2.707,0.642,4.947,2.993,3.765,1.243,2.762,0.655,0.969,1.845,1.893,2.305,0.254,0.727,2.391,3.112,4.753,1.278,1.925,5.446,0.994,0.679,0.959,6.124,3.354,4.309,6.55,0.107,1.23,7.354,1.903,1.297,2.502,5.595,2.663,1.702,2.211,2.928,1.213,9.362,0.073,3.8,0.658,1.329,3.026,5.619,2.505,4.709,1.264,1.102,0.39,1.884,3.754,2.733,4.581,8.149,7.267,0.425,4.632,0.028,1.981,9.039,1.22,2.015,4.624,7.579,2.079,1.274,1.645,3.831,1.203,0.454,3.814,2.608,0.667,2.865,0.291,2.535,0.926,7.612,1.964,0.252,6.084,0.237,2.085,3.754,3.238,6.108,2.57,0.151,3.343))
pdf("/ifs4/BC_PUB/biosoft/pipeline/RNA/RNA_RNAseq/RNA_RNAseq_2017a/example/result.SE/process/GeneExp_RSEM/HBRR1/HBRR1.ReadsCoverage.pdf",width=10,height=8)
par(omi=c(0.165,0.3,0,1.1))
barplot(data,space=0.3,col="#377EB8",xlab="Percent covered",axes=F,ylab="",cex.lab=1.5,border=0,width=0.5)
axis(2,col="#377EB8",col.axis="#377EB8",las=2)
mtext(side=2,"Percentage of transcripts",line=3,cex=1.5,col="#377EB8")
par(new=T)
par(omi=c(0,0.3,0,1.1))
plot(den,yaxt="n",ylab="",xaxt="n",axes=F,xlab="",main="")
lines(den,lty=1,col="grey40",lwd=2)
axis(4,col="grey40",col.axis="grey40",las=2)
mtext(side=4,"Density",line=5,cex=1.5,col="grey40")
dev.off()
|
102f9674b9c1f4b2f25604442924bf2fdfeb61c4
|
3398f060d05e70146715226881fc6d583ec17eb3
|
/starbucks.R
|
efa199ac3bc8f6dc05cd31a68ccf942090fb13af
|
[] |
no_license
|
Jeong-hae-rim/StudyR
|
26959a0490068a9024688d65daec3d6cc7b99de5
|
fce3219e166995016def419115888bf340785bd2
|
refs/heads/master
| 2021-04-16T09:18:21.378019
| 2020-05-28T10:03:08
| 2020-05-28T10:03:08
| 249,344,990
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,968
|
r
|
starbucks.R
|
# [ 동적 크롤링 수행평가 ]
### 웹사이트 불러내기
library(RSelenium)
remDr <- remoteDriver(remoteServerAddr = "localhost", port = 4445, browserName = "chrome")
remDr$open()
remDr$navigate("https://www.istarbucks.co.kr/store/store_map.do?disp=locale")
### 전체 매장 개수 추출
sizeCss <- "#container > div > form > fieldset > div > section > article.find_store_cont > article > article:nth-child(4) > div.loca_step3 > div.result_num_wrap > span"
size <- remDr$findElements(using='css selector', sizeCss)
limit <- sapply(size, function(x){x$getElementText()})
### 3개의 매장 정보를 읽고 세 번째 매장 DoM객체 위에서 스크롤 이벤트 발생
### (마지막 매장에 도달한 경우 더이상 스크롤이벤트 발생 불필요.)
indexlink <- NULL
reple <- NULL
index <- 1
shopname <- NULL
lat <- NULL
lng <- NULL
shopaddr <- NULL
shopphone <- NULL
repeat{
indexCss <- paste("#mCSB_3_container > ul > li:nth-child(",index,")", sep='')
indexlink <- remDr$findElements(using='css selector', indexCss)
indexlink2 <- sapply(indexlink, function (x) {x$getElementText()})
doms <-unlist(strsplit(unlist(indexlink2),"\n"))
shopname <- append(shopname, doms[1])
shopaddr <- append(shopaddr, doms[2])
shopphone <- append(shopphone, doms[3])
lat <- append(lat, unlist(sapply(indexlink, function(x) {
x$getElementAttribute("data-lat")
})))
lng <- append(lng, unlist(sapply(indexlink, function(x) {
x$getElementAttribute("data-long")
})))
cat(length(reple), "\n")
if(index %% 3 == 0 && index != limit){
remDr$executeScript(
"var dom = document.querySelectorAll('#mCSB_3_container > ul > li')[arguments[0]];
dom.scrollIntoView();", list(index))
}
index <- index+1
}
df <- data.frame(매장명=shopname, 위도=lat, 경도=lng, 주소=shopaddr, 전화번호=shopphone)
View(df)
write.csv(df, file="starbucks.csv")
|
58ea82aaff809b6e32534cff764701837fe5a1f7
|
a4021a064ad356d5b261ae116eec8d96e74eefb9
|
/R/ubio_search.R
|
94e2080473e68b1b46b2bf608060063b34d988ce
|
[
"CC0-1.0"
] |
permissive
|
dlebauer/taxize_
|
dc6e809e2d3ba00a52b140310b5d0f416f24b9fd
|
9e831c964f40910dccc49e629922d240b987d033
|
refs/heads/master
| 2020-12-24T23:28:49.722694
| 2014-04-01T18:22:17
| 2014-04-01T18:22:17
| 9,173,897
| 1
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,067
|
r
|
ubio_search.R
|
#' This function will return NameBankIDs that match given search terms
#'
#' @import httr XML RCurl plyr
#' @param searchName (string) - term to search within name string
#' @param searchAuth (string) - term to search within name authorship
#' @param searchYear (string) - term to search within name year
#' @param order (string) - (name or namebankID) field by which the results will
#' be sorted (default is namebankID)
#' @param sci (int) - (sci, vern, or all) type of results to be returned
#' (default is all)
#' @param vern (int) - (limit 1000) maximum number of results to be returned
#' (default is 1000)
#' @param keyCode Your uBio API key; loads from .Rprofile. If you don't have
#' one, obtain one at http://www.ubio.org/index.php?pagename=form.
#' @param callopts Parameters passed on to httr::GET call.
#' @return A data.frame.
#' @examples \dontrun{
#' ubio_search(searchName = 'elephant', sci = 1, vern = 0)
#' ubio_search(searchName = 'Astragalus aduncus', sci = 1, vern = 0)
#' }
#' @export
ubio_search <- function(searchName = NULL, searchAuth = NULL, searchYear=NULL,
order = NULL, sci = NULL, vern = NULL, keyCode = NULL, callopts=list())
{
url = "http://www.ubio.org/webservices/service.php"
keyCode <- getkey(keyCode, "ubioApiKey")
args <- compact(list('function' = 'namebank_search', searchName = searchName,
searchAuth = searchAuth,
searchYear = searchYear, order = order,
sci = sci, vern = vern, keyCode = keyCode))
tmp <- GET(url, query=args, callopts)
stop_for_status(tmp)
tt <- content(tmp)
toget <- c("namebankID", "nameString", "fullNameString", "packageID",
"packageName", "basionymUnit", "rankID", "rankName")
temp2 <- lapply(toget, function(x) sapply(xpathApply(tt, paste("//", x, sep="")), xmlValue))
temp2[2:3] <- sapply(temp2[2:3], base64Decode)
out <- data.frame(do.call(cbind, temp2))
names(out) <- c("namebankid", "namestring", "fullnamestring", "packageid",
"packagename", "basionymunit", "rankid", "rankname")
out
}
|
cdb6307aca6b093dedd794bab190d3f6a6355587
|
9c9b649e7ca7c9d3d9be3c035bdd4cf9fb2db4e6
|
/demographic_social_28.R
|
898e5ce88596dbdc99abbb782ccf354fe9157bf4
|
[] |
no_license
|
ktorresSD/measures.script
|
5bb409cc0df8c535ae282ce05f33f2f899d8977e
|
1ec87f4e8d2bd507ef38374085f0bb2c7486c785
|
refs/heads/master
| 2021-10-21T21:40:32.005909
| 2019-03-06T18:19:56
| 2019-03-06T18:19:56
| 114,813,457
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,607
|
r
|
demographic_social_28.R
|
#########################################################################################
# Last Date modified: 12/19/2017
# Author: Katy Torres
# Description: Subset of question 28, Demographic: Social Environment
##########################################################################################
#Load plyr library
library(plyr)
#To the user: Set path to where data is stored
setwd("~/Biobank/data")
#________________________________________________________________________________________
#READ AND SUBSET LARGE DATA TO ONLY CONTAIN DESIRED QUESTIONAIRE VARIABLES
#----------------------------------------------------------------------------------------
#Read all data
dat0 <- read.csv('joined_data_export_20171218.csv',header=T,na.strings=c(NA,999))
#Only retain relevant variables
datdemosocial <- subset(dat0,
select= c(assessment_id,vista_lastname,
demo_livewith_alone,
demo_livewith_parent,
demo_livewith_friend,
demo_livewith_spouse,
demo_livewith_child,
demo_livewith_other,
demo_livewith_otherspec,
demo_emo_none,
demo_emo_parents,
demo_emo_friends,
demo_emo_spouse,
demo_emo_therapist,
demo_emo_spiritual,
demo_emo_children,
demo_emo_other,
demo_emo_other_spec,
demo_rel_hurt,
child_agegroup,
demo_children,
child_count
))
#________________________________________________________________________________________
# Data Manipulation and cleaning
#----------------------------------------------------------------------------------------
#________________________________________________________________________________________
# SCORING Functions Defined
#----------------------------------------------------------------------------------------
#________________________________________________________________________________________
#Export data
#----------------------------------------------------------------------------------------
write.csv( datdemosocial, "~/Biobank/28_Demo_Social/Demographic_social_reduced_data_export_20171219.csv",quote=T,row.names=F,na="#N/A")
|
747c0eb4caedbf2eede4b6789c95577d5076c383
|
f2a0a8fda06fc7c1a7602472aab8569df5101d48
|
/man/cooks.distance.frontier.Rd
|
ce3d1a08cc2005dbc9d19691e71436a1c0906ad3
|
[] |
no_license
|
cran/frontier
|
833b64b32ae93e7f5c8333ccbbd3670f0fa12182
|
91725b1e6bb2df9b47c3d9eda2d545996a0f0c54
|
refs/heads/master
| 2021-01-01T19:07:23.783127
| 2020-04-17T15:10:03
| 2020-04-17T15:10:03
| 17,696,150
| 5
| 4
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,402
|
rd
|
cooks.distance.frontier.Rd
|
\name{cooks.distance.frontier}
\alias{cooks.distance.frontier}
\title{Pseudo-Cook's Distance of Stochastic Frontier Models}
\description{
This method returns the Pseudo-Cook's distances
from stochastic frontier models
estimated with the \pkg{frontier} package
(e.g., function \code{\link{sfa}}).
}
\usage{
\method{cooks.distance}{frontier}( model, target = "predict",
asInData = FALSE, progressBar = TRUE, \dots )
}
\arguments{
\item{model}{a stochastic frontier model
estimated with the \pkg{frontier} package
(e.g. function \code{\link{sfa}}).}
\item{target}{character string.
If \code{"predict"}, the returned values indicate
the influence of individual observations on the predicted values;
if \code{"efficiencies"}, the returned values indicate
the influence of individual observations on the efficiency estimates.}
\item{asInData}{logical. If \code{FALSE}, the returned vector
only includes observations that were used in the estimation;
if \code{TRUE}, the length of the returned vector is equal
to the total number of observations in the data set,
where the values in the returned vector
that correspond to observations
that were not used in the estimation
due to \code{NA} or infinite values
are set to \code{NA}.}
\item{progressBar}{logical. Should a progress bar be displayed
while the Cook's distances are obtained?}
\item{\dots}{additional arguments that arecurrently ignored
if argument \code{target} is \code{"predict"}
and that are passed to the \code{efficiencies()} method
if argument \code{target} is \code{"efficiencies"}.}
}
\value{
A vector of the Pseudo-Cook's distances for each observation
that was used in the estimation that is provided as argument \code{model}.
}
\author{Arne Henningsen}
\seealso{\code{\link{sfa}}, \code{\link{cooks.distance}}.}
\examples{
# example included in FRONTIER 4.1 (cross-section data)
data( front41Data )
# Cobb-Douglas production frontier
cobbDouglas <- sfa( log( output ) ~ log( capital ) + log( labour ),
data = front41Data )
summary( cobbDouglas )
# Pseudo-Cook's distances for predicted values
cooks.distance( cobbDouglas )
# Pseudo-Cook's distances for efficiency estimates
cooks.distance( cobbDouglas, "efficiencies" )
}
\keyword{methods}
|
d70d98a147c53e2df186ef489505768bf4b54e4f
|
de1783a918228f611f766fe1b746e048f5022b70
|
/CostMinProblem.R
|
9125427418b855fc2254b7628781b4111a60463c
|
[
"MIT"
] |
permissive
|
nsbowden/Rwanda_Solar_Initiative
|
009141bd5df1136c97e521777f7cb646ae3b1765
|
87fba8d85965fe982e111ddd469a4f75fab95f74
|
refs/heads/master
| 2020-03-06T21:42:18.889646
| 2019-01-13T03:06:07
| 2019-01-13T03:06:07
| 127,084,515
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 4,196
|
r
|
CostMinProblem.R
|
###################################################
### Isolated PV Model ########
### Designed for 1 year of hourly Data ########
###################################################
library(ggplot2)
###Read Irrandaince and Load Files and combine
###Set path to directory containing input files
path = '../Data/GeneratedData/'
solar = read.csv(paste(path, "Hourly_Irradiance_Bakokwe.csv", sep=''), stringsAsFactors=FALSE)
load = read.csv(paste(path, "YearlyLoadHourly.csv", sep=""), stringsAsFactors=FALSE)
d = cbind(solar, load)
names(d) = c('hour', 'sun', 'load')
###Some example graphics generated with the ggplot library
#The whole time period: Irradiance
ggplot(d, aes(x = hour, y = sun)) + geom_line()
#The whole time period with labels: Irradiance
ggplot(d, aes(x=hour)) + geom_line(aes(y=sun), color='green4') +
ylab("Watts") + xlab("hour") + ggtitle("Bakokwe Irradiance Data") +
theme(plot.title = element_text(hjust = 0.5))
#The 1st 10 days: Irradiance
ggplot(d[1:240,], aes(x=hour[1:240])) + geom_line(aes(y=sun[1:240]), color='green4') +
ylab("Watts") + xlab("hour") + ggtitle("Bakokwe Irradiance Data") +
theme(plot.title = element_text(hjust = 0.5))
#The 1st 10 days: Load
ggplot(d[1:240,], aes(x=hour[1:240])) + geom_line(aes(y=load[1:240]), color='blue') +
ylab("Watts") + xlab("hour") + ggtitle("Rural Rwandan Load Data") +
theme(plot.title = element_text(hjust = 0.5))
#The 1st 5 days: Irradiance and Load
ggplot(d[1:120,], aes(x=d$hour[1:120])) + geom_line(aes(y=d$sun[1:120]*0.1), color='green4') +
geom_line(aes(y=d$load[1:120]), color='blue') + ylab("Watts") + xlab("Hour") +
ggtitle("Bakokwe System Data") + theme(plot.title = element_text(hjust = 0.5))
#######################################################################
############## The Optimization Program #####################
#######################################################################
#The program implements an exhaustive grid search for the minimum
#cost combination of pv modules and batteries to serve a lighting
#and minor auxillary load system.
#######################################################################
################# Model Parameters #############################
#unit costs in $ per kW and $ per kWh for pv and battery respecitively
#battery depth is used as a constraint in the model
#pv.unit.watts is the discrete/incremental pv module size
#bat.inc is the discrete/incremental battery size
pvUnitCost=0.4
pvEfficiency = 0.1
pvUnitWatts = 200
batUnitCost=0.2
batInc = 600
batEfficiency = 0.8
batDepth = 0.55
############ OUtput Matrices ##################
#Output matrices illustrating the model and used to
#find optimal combination
costGrid = matrix(rep(0,100), nrow=10)
violGrid = matrix(rep(0,100), nrow=10)
#####################################################
##### Algorithm to fill the matrices ################
for (i in 1:10){
pvSize = i
pvCost = pvSize*pvUnitWatts*pvUnitCost
for (j in 1:10){
batSize = j
batCapacity = batInc*batSize
batCost = batUnitCost*batCapacity
costGrid[[i,j]] = pvCost + batCost
battery = list()
battery[[1]]= batCapacity #initally the battery is full
for (k in 1:length(d$sun)){
temp = battery[[k]] + pvSize*d$sun[[k]]*pvEfficiency - d$load[[k]]/batEfficiency
if (temp>batCapacity) {
battery[[k+1]] = batCapacity
} else {
battery[[k+1]] = temp
}
}
violGrid[[i,j]] = length(battery[battery<batDepth*batCapacity])
}
}
########################################################
########## The Output and Analysis #####################
##Set the reliablity tolerance, the number of hours the battery is allowed to go below
##its recommended/planned depth of discharge, set above as batepth
constSet = costGrid
reliabilityTolerence = 0
constSet[violGrid>reliabilityTolerence]=NA
##Find the min cost
m = min(constSet, na.rm=TRUE)
which(constSet == m, arr.ind=TRUE)
##########Visualizations of the Output ###########################
heatmap(violGrid, Rowv=NA, Colv=NA, symm=TRUE)
heatmap(costGrid, Rowv=NA, Colv=NA, symm=TRUE)
heatmap(constSet, Rowv=NA, Colv=NA, symm=TRUE)
|
647583f8440498ae39ad35aee8cbb04e0ec24e82
|
ab10f7fde360490c080c9a1184f8c868ace0cac8
|
/man/myorcid.Rd
|
8f08048cca9f3d5aa81fbf58925c6509fddff653
|
[
"CC-BY-4.0"
] |
permissive
|
cathblatter/cblttr
|
ca6b0160f25cd89d370aecc728f96e8cbd1e5365
|
41aaf0829084a545b9d7e0dcfa3df6c044c95412
|
refs/heads/main
| 2022-11-27T10:58:31.135308
| 2022-11-27T06:52:25
| 2022-11-27T06:52:25
| 161,007,732
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| true
| 273
|
rd
|
myorcid.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/myorcid.R
\docType{data}
\name{myorcid}
\alias{myorcid}
\title{My orcid}
\format{
An object of class \code{character} of length 1.
}
\usage{
myorcid
}
\description{
My orcid
}
\keyword{datasets}
|
ddf6ed8d1a7ce47e5ad75eb7dfe942151666b442
|
917c9867f05b73b37c7d68d28fe4a1c57702fd28
|
/Basic/sorting.R
|
17f6599c2e6749bc9fa97ce022b58cc37e568df0
|
[] |
no_license
|
xiabofei/rlanguage
|
e06f58dd25629bd11206369a4189220605bfe550
|
809435e5da08427f33223dee367d161e20a0424c
|
refs/heads/master
| 2020-12-06T17:14:31.562219
| 2016-09-27T06:20:29
| 2016-09-27T06:20:29
| 66,824,872
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 213
|
r
|
sorting.R
|
## 1. 排序且取下标的做法
D <- data.frame(x=c(1,2,3,1),y=c(7,19,2,2))
# order是降序排列, 返回的是vector的下标
indexs <- order(D$x)
D[indexs,]
# rev是取反
rev(c(1,2,3,4))
D[rev(order(D$y)),]
|
f298507d11b10aa80234c9af66ecafe68c66a8a2
|
ccb47c269948c24052669e1afda69ebfee5d2603
|
/modules/conversion_display_module.R
|
5708554ca83921e34703c23a38315bc8706de9c1
|
[] |
no_license
|
aquacalc/iQuaCalc_R
|
57f93d48f0359830d8b4e6527b7f2523b31177a9
|
2f5fbdf89361d8f1c81071bef3cfd0b2dfd04e8a
|
refs/heads/master
| 2020-03-19T05:23:43.478688
| 2018-06-03T22:36:57
| 2018-06-03T22:36:57
| 135,925,549
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 4,863
|
r
|
conversion_display_module.R
|
# conversion_display_module.R
# when user clicks a cell in a conversion table,
# display the appropriate conversion result in a box
conversionDisplayModuleInput <- function(id) {
ns <- NS(id)
tagList(
box(
style = "padding: 3px 2px 1px 2px;",
width = NULL,
# title = "Click a table cell to display a conversion",
solidHeader = T,
status = 'primary',
htmlOutput(ns('conversion_result')),
background = 'light-blue'
)
) # END tagList
} # END module UI function, conversionDisplayInput
conversionDisplayModule <- function(input, output, session,
inputVal, inputUnits, # the value & units converting FROM
df, info, # dataframe of all conversions & list of clicked cell coordinates
cell_selected, # matrix of coordinates of selected cell
other_data, # string of any relevant factors, such as pH (NBS) for UIA-N conversion
st) {
clicked_cell_data <- eventReactive(c(cell_selected(),
df()), {
my_str <- 'click a value in a table cell to display a conversion'
# cell_coords <- input$ammonia_convert_dt_cells_selected
# info <- input$ammonia_convert_dt_cell_clicked
if(is.null(info()$col)) {
str <- my_str
} else {
num_cols <- ncol(df()$df) - 1 # "-1" because DT is 0-indexed javascript
# if((info()$col + 1) != 5) {
if((info()$col + 1) != num_cols) {
cell_datum <- df()$df[info()$row, info()$col + 1]
cell_units <- paste0(df()$df[info()$row, num_cols], ' ',
colnames(df()$df)[info()$col + 1])
# cheap-and-very-dirty...
# in_ammonia_nitrogen <- colnames(df()$df)[info()$col + 1]
# if('UIAN' == in_ammonia_nitrogen)
# cell_units <- paste0(cell_units, 'UIA-N')
# if('TAN' == in_ammonia_nitrogen)
# cell_units <- paste0(cell_units, 'TA-N')
# cat('\nin conversion_display_module.R/clicked_cell_data()...\n')
# cat('0. cell_datum = ', cell_datum, '\n')
# cat('0. cell_units = ', cell_units, '\n')
# print(colnames(df()$df)[info()$col + 1])
# see: https://www.rdocumentation.org/packages/stringr/versions/1.1.0/topics/str_sub
x <- "UIAN"
y <- 'TAN'
to_N <- 'A-'
if(TRUE == grepl(x, cell_units) || TRUE == grepl(y, cell_units)) {
str_sub(cell_units, -2, -2) <- to_N
}
# cat('1. cell_units = ', cell_units, '\n')
# cat('==========\n\n')
str <- paste0(cell_datum, ' ', cell_units)
# cat(' str = ', str, '\n')
# cat('word(str, 1, -2) = ', word(str, 1, -2), '\n')
# cat('==========\n\n')
str
} else {
str <- my_str
}
}
str
})
output$conversion_result <- renderUI({
str1 <- paste0(inputVal(),' ',
inputUnits(), ' = ')
str2 <- clicked_cell_data()
# cat('in conversion_display_module.R...', grepl('click', str2), '\n')
# cat(' other_data()', other_data(), '\n')
if(TRUE == grepl('click', str2)) {
HTML(paste(tags$h5(str2, style = "text-align: center;")))
} else {
if(!is.null(other_data())) {
result_str <- word(str2, 1, -2)
if(TRUE == grepl('UIA-N', str2) ||
TRUE == grepl('TA-N', str2) ||
TRUE == grepl('TA', str2) ||
TRUE == grepl('UIA', str2)) {
result_str <- str2
}
HTML(paste(tags$h4(str1, result_str, other_data(),
# HTML(paste(tags$h4(str1, word(str2, 1, -2), other_data(),
# see: https://shiny.rstudio.com/articles/css.html
style = "text-align: center;")
)
)
} else {
# cat('str1 = ', str1, '\n')
# cat('str2 = ', str2, '\n')
# cat('str2 = ', word(str2, 1, -2), '\n')
HTML(paste(tags$h4(str1, word(str2, 1, -2), tags$br(), # last string, 'tags$br()', adds blank line
# see: https://shiny.rstudio.com/articles/css.html
style = "text-align: center;")
)
)
}
}
})
}
|
f0a85e3a9c98cc738dc183cf27d102a2e34924e9
|
b0cb6e6cb543e1c7ed03c499c3be80f72c5237a0
|
/man/Param_blipCDF.Rd
|
2dc524fc5217fd9a58b990f6638a4f73a4529f74
|
[] |
no_license
|
jlstiles/tmle3kernel
|
c029d35998fc9481026e7cc319222ae5f11fa18d
|
cf3c751b2d4b812b6475c925fa1c003056809bcc
|
refs/heads/master
| 2020-04-03T00:33:59.193873
| 2018-10-26T23:58:46
| 2018-10-26T23:58:46
| 154,902,558
| 0
| 0
| null | 2018-10-26T22:52:44
| 2018-10-26T22:52:43
| null |
UTF-8
|
R
| false
| true
| 1,547
|
rd
|
Param_blipCDF.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Param_blipCDF.R
\docType{data}
\name{Param_blipCDF}
\alias{Param_blipCDF}
\title{Blip CDF}
\format{\code{\link{R6Class}} object.}
\usage{
Param_blipCDF
}
\value{
\code{Param_base} object
}
\description{
Blip CDF
}
\section{Constructor}{
\code{define_param(Param_ATT, observed_likelihood, intervention_list, ..., outcome_node)}
\describe{
\item{\code{observed_likelihood}}{A \code{\link{Likelihood}} corresponding to the observed likelihood
}
\item{\code{intervention_list_treatment}}{A list of objects inheriting from \code{\link{LF_base}}, representing the treatment intervention.
}
\item{\code{intervention_list_control}}{A list of objects inheriting from \code{\link{LF_base}}, representing the control intervention.
}
\item{\code{...}}{Not currently used.
}
\item{\code{outcome_node}}{character, the name of the node that should be treated as the outcome
}
}
}
\section{Fields}{
\describe{
\item{\code{cf_likelihood_treatment}}{the counterfactual likelihood for the treatment
}
\item{\code{cf_likelihood_control}}{the counterfactual likelihood for the control
}
\item{\code{intervention_list_treatment}}{A list of objects inheriting from \code{\link{LF_base}}, representing the treatment intervention
}
\item{\code{intervention_list_control}}{A list of objects inheriting from \code{\link{LF_base}}, representing the control intervention
}
}
}
\concept{Parameters}
\keyword{data}
|
c76b1d723a557009f69ac59f43ebc37d5300dd75
|
20953caa1b29bfa8983d2f9d88c5e72c8794e796
|
/4c.Analysis-SICR_Def-All_Prevalence.R
|
39e2bd17913846aa3c40f791100f8817c78b27b8
|
[
"MIT",
"CC-BY-4.0",
"CC-BY-3.0"
] |
permissive
|
arnobotha/IFRS9-SICR-Definitions-Logit
|
14298c71540f71a77630a4d4c2b60f81a318eb5d
|
520e85ea4c47e76abae920f9320e90640643e711
|
refs/heads/main
| 2023-04-15T07:41:00.341358
| 2023-03-02T12:16:16
| 2023-03-02T12:16:16
| 601,805,307
| 1
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 12,319
|
r
|
4c.Analysis-SICR_Def-All_Prevalence.R
|
# ============================== SICR-DEFINITION ANALYSIS ===============================
# Script for comparing SICR-prevalence rates across various SICR-definitions.
# In particular, we analyse definition class 1-2 and compare results across (d,s,k)-parameters
# ---------------------------------------------------------------------------------------
# PROJECT TITLE: Dynamic SICR-research
# SCRIPT AUTHOR(S): Dr Arno Botha
# ---------------------------------------------------------------------------------------
# -- Script dependencies:
# - 0.Setup.R
# - 1.Data_Import.R
# - 2b.Data_Preparation_Credit.R
# - 2c.Data_Enrich.R
# - 2d.Data_Fusion.R
# - 3a.SICR_def_<>_logit.R | the 3a-series of scripts for definitions 1a-2c, for (i)-(iv)
# -- Inputs:
# - datSICR_smp_<> | specific SICR-sample upon which resampling scheme is applied (3a)
# -- Outputs:
# - <analytics>
# =======================================================================================
# ------ 1. SICR-Incidence/prevalence across SICR-definitions
# --- 1. Load each sample into memory and bind together successively
SICR_label <- "1a(i)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target , SICR_Def=SICR_label, d=1, s=1, k=3)]); rm(datSICR_smp)
SICR_label <- "1a(ii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=1, k=6)])); rm(datSICR_smp)
SICR_label <- "1a(iii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=1, k=9)])); rm(datSICR_smp)
SICR_label <- "1a(iv)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=1, k=12)])); rm(datSICR_smp)
SICR_label <- "1a(v)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=1, k=18)])); rm(datSICR_smp)
SICR_label <- "1a(vi)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=1, k=24)])); rm(datSICR_smp)
SICR_label <- "1a(vii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=1, k=36)])); rm(datSICR_smp)
# rm(datSICR)
SICR_label <- "1b(i)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=2, k=3)])); rm(datSICR_smp)
SICR_label <- "1b(ii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=2, k=6)])); rm(datSICR_smp)
SICR_label <- "1b(iii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=2, k=9)])); rm(datSICR_smp)
SICR_label <- "1b(iv)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=2, k=12)])); rm(datSICR_smp)
# rm(datSICR)
SICR_label <- "1c(i)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target , SICR_Def=SICR_label, d=1, s=3, k=3)])); rm(datSICR_smp)
SICR_label <- "1c(ii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=3, k=6)])); rm(datSICR_smp)
SICR_label <- "1c(iii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=3, k=9)])); rm(datSICR_smp)
SICR_label <- "1c(iv)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=1, s=3, k=12)])); rm(datSICR_smp)
SICR_label <- "2a(i)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=1, k=3)])); rm(datSICR_smp)
SICR_label <- "2a(ii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=1, k=6)])); rm(datSICR_smp)
SICR_label <- "2a(iii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=1, k=9)])); rm(datSICR_smp)
SICR_label <- "2a(iv)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=1, k=12)])); rm(datSICR_smp)
SICR_label <- "2b(i)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target , SICR_Def=SICR_label, d=2, s=2, k=3)])); rm(datSICR_smp)
SICR_label <- "2b(ii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=2, k=6)])); rm(datSICR_smp)
SICR_label <- "2b(iii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=2, k=9)])); rm(datSICR_smp)
SICR_label <- "2b(iv)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=2, k=12)])); rm(datSICR_smp)
SICR_label <- "2c(i)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target , SICR_Def=SICR_label, d=2, s=3, k=3)])); rm(datSICR_smp)
SICR_label <- "2c(ii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=3, k=6)])); rm(datSICR_smp)
SICR_label <- "2c(iii)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=3, k=9)])); rm(datSICR_smp)
SICR_label <- "2c(iv)"
if (!exists('datSICR_smp')) unpack.ffdf(paste0(genPath,"datSICR_smp_", SICR_label), tempPath)
datSICR <- rbind(datSICR, copy(datSICR_smp[, list(LoanID, Date, SICR_def, SICR_events=SICR_target, SICR_Def=SICR_label, d=2, s=3, k=12)])); rm(datSICR_smp)
# --- 2. Prevalence analysis
# 1a
datSICR.aggr <- datSICR[d==1 & s==1,list(SICR_Obs = sum(as.numeric(levels(SICR_events))[SICR_events], na.rm=T), k = mean(k),
Prevalence = mean(as.numeric(levels(SICR_events))[SICR_events], na.rm=T)), by=list(SICR_Def)]
datSICR.aggr
sprintf("%.2f", datSICR.aggr$Prevalence*100)
plot(datSICR.aggr$k, datSICR.aggr$SICR_Obs, type="b")
plot(datSICR.aggr$k, datSICR.aggr$Prevalence, type="b")
# Same shape regardless of SICR_Obs and prevalence, so we'll default to prevalence
datSICR.aggr.final <- data.table(datSICR.aggr, d=1, s=1)
# 1b
datSICR.aggr <- datSICR[d==1 & s==2,list(SICR_Obs = sum(as.numeric(levels(SICR_events))[SICR_events], na.rm=T), k = mean(k),
Prevalence = mean(as.numeric(levels(SICR_events))[SICR_events], na.rm=T)), by=list(SICR_Def)]
datSICR.aggr
sprintf("%.2f", datSICR.aggr$Prevalence*100)
#plot(datSICR.aggr$k, datSICR.aggr$SICR_Obs, type="b")
plot(datSICR.aggr$k, datSICR.aggr$Prevalence, type="b")
datSICR.aggr.final <- rbind(datSICR.aggr.final, data.table(datSICR.aggr, d=1, s=2) )
# 1c
datSICR.aggr <- datSICR[d==1 & s==3,list(SICR_Obs = sum(as.numeric(levels(SICR_events))[SICR_events], na.rm=T), k = mean(k),
Prevalence = mean(as.numeric(levels(SICR_events))[SICR_events], na.rm=T)), by=list(SICR_Def)]
datSICR.aggr
sprintf("%.2f", datSICR.aggr$Prevalence*100)
#plot(datSICR.aggr$k, datSICR.aggr$SICR_Obs, type="b")
plot(datSICR.aggr$k, datSICR.aggr$Prevalence, type="b")
datSICR.aggr.final <- rbind(datSICR.aggr.final, data.table(datSICR.aggr, d=1, s=3) )
# 2a
datSICR.aggr <- datSICR[d==2 & s==1,list(SICR_Obs = sum(as.numeric(levels(SICR_events))[SICR_events], na.rm=T), k = mean(k),
Prevalence = mean(as.numeric(levels(SICR_events))[SICR_events], na.rm=T)), by=list(SICR_Def)]
datSICR.aggr
sprintf("%.2f", datSICR.aggr$Prevalence*100)
#plot(datSICR.aggr$k, datSICR.aggr$SICR_Obs, type="b")
plot(datSICR.aggr$k, datSICR.aggr$Prevalence, type="b")
datSICR.aggr.final <- rbind(datSICR.aggr.final, data.table(datSICR.aggr, d=2, s=1) )
# 2b
datSICR.aggr <- datSICR[d==2 & s==2,list(SICR_Obs = sum(as.numeric(levels(SICR_events))[SICR_events], na.rm=T), k = mean(k),
Prevalence = mean(as.numeric(levels(SICR_events))[SICR_events], na.rm=T)), by=list(SICR_Def)]
datSICR.aggr
sprintf("%.2f", datSICR.aggr$Prevalence*100)
#plot(datSICR.aggr$k, datSICR.aggr$SICR_Obs, type="b")
plot(datSICR.aggr$k, datSICR.aggr$Prevalence, type="b")
datSICR.aggr.final <- rbind(datSICR.aggr.final, data.table(datSICR.aggr, d=2, s=2) )
# 2c
datSICR.aggr <- datSICR[d==2 & s==3,list(SICR_Obs = sum(as.numeric(levels(SICR_events))[SICR_events], na.rm=T), k = mean(k),
Prevalence = mean(as.numeric(levels(SICR_events))[SICR_events], na.rm=T)), by=list(SICR_Def)]
datSICR.aggr
sprintf("%.2f", datSICR.aggr$Prevalence*100)
#plot(datSICR.aggr$k, datSICR.aggr$SICR_Obs, type="b")
plot(datSICR.aggr$k, datSICR.aggr$Prevalence, type="b")
datSICR.aggr.final <- rbind(datSICR.aggr.final, data.table(datSICR.aggr, d=2, s=3) )
# - Save results
write_xlsx(x=datSICR.aggr.final,path=paste0(genObjPath, "PrevalenceRates.xlsx"))
# - Cleanup
rm(datSICR); gc()
# -- Analysis: Varying stickiness for class 1
plot.obj <- subset(datSICR.aggr.final, d==1 & k <= 12)
plot.obj[, Group := factor(s)]
ggplot(plot.obj,aes(x=k,y=Prevalence, group=Group)) + theme_minimal() +
geom_line(aes(colour=Group, linetype=Group), size=1) +
geom_point(aes(colour=Group, shape=Group), size=3) +
scale_y_continuous(label=percent) + scale_x_continuous(breaks=pretty_breaks(4), label=label_number(accuracy=1))
### RESULTS: Prevalence decreases as k increases, like for class 1a
|
15b24a7bbf91dce594b6febc1de9a62e947b3c16
|
8cd4132aa6e0ff35bf198b6b64077ba5fd46c962
|
/toCytoscape.R
|
3cdbc0769638a065f599138ac0c4896876705978
|
[] |
no_license
|
mandalr2/cy-rest-R
|
e0dcaaf52d35859ebc4cf96e6d4429b75fd7d607
|
de68b10edb4b16c46646758af82c3ceb668efe73
|
refs/heads/master
| 2020-12-24T11:06:03.483138
| 2014-08-01T18:42:57
| 2014-08-01T18:42:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,000
|
r
|
toCytoscape.R
|
toCytoscape <- function (igraphobj) {
# Extract graph attributes
graph_attr = graph.attributes(igraphobj)
# Extract nodes
node_count = length(V(igraphobj))
V(igraphobj)$id <-c(1:node_count)
nodes <- V(igraphobj)
nds = list()
v_attr = vertex.attributes(igraphobj)
v_names = list.vertex.attributes(igraphobj)
for(i in 1:node_count) {
node_attr = list()
for(j in 1:length(v_attr)) {
if(v_names[j] == "id") {
node_attr[j] = toString(v_attr[[j]][i])
} else {
node_attr[j] = v_attr[[j]][i]
}
}
names(node_attr) = v_names
nds[[i]] = list(data = node_attr)
}
edges <- get.edgelist(igraphobj)
edge_count = ecount(igraphobj)
eds = list()
for(i in 1:edge_count) {
edge_attr = list(source=toString(edges[i,1]), target=toString(edges[i,2]))
eds[[i]] = list(data=edge_attr)
}
el = list(nodes=nds, edges=eds)
x <- list(data = graph_attr, elements = el)
return (toJSON(x))
}
|
c6b6ce97614d9922e31038e8b29cfc0c98cef8bb
|
97cbdbd0cfc732799c8c236e8afd3a77d0c78585
|
/GGPlot/facebook-ggplot.r
|
bf872a8b54262271cc2d04a05adaf177a5c3e2c6
|
[] |
no_license
|
everydaylife/Data_Visualization
|
36dc0a95a2e6857cee39720033b7df5fb4e83fe1
|
e7715078ec07e085dadbc82260dca8004440d41f
|
refs/heads/master
| 2016-08-11T06:51:17.844062
| 2016-03-22T00:24:24
| 2016-03-22T00:24:24
| 54,432,633
| 1
| 1
| null | null | null | null |
UTF-8
|
R
| false
| false
| 8,292
|
r
|
facebook-ggplot.r
|
# Comparing Demographics of Facebook Users to Non-Users
# Jump Start Code Segment via Thomas Miller
# load required libraries
library(ggplot2)
library(vcd)
library(plyr)
# Load R binary file
load("facebook.RData")
# set text data fields as character
original.facebook.data.frame$pial4vb <- as.character(original.facebook.data.frame$pial4vb)
original.facebook.data.frame$pial7vb <- as.character(original.facebook.data.frame$pial7vb)
# define sex as factor variable
original.facebook.data.frame$sex <- factor(original.facebook.data.frame$sex,
levels = c(1,2), labels = c("Male","Female"))
# define factor variable for facebook user
original.facebook.data.frame$facebook_user <- ifelse((original.facebook.data.frame$pial2 == 1),2,1)
original.facebook.data.frame$facebook_user <- factor(original.facebook.data.frame$facebook_user,
levels = c(1,2), labels = c("Non-User","User"))
# define new data fame for work
working.data.frame <- original.facebook.data.frame
# define Internet user data frame
net <- subset(working.data.frame, subset = (intuse == 1))
# list the variables and show structure in the data frame
print(names(net))
print(str(net))
# 1. Basic understanding of data: histograms and bar charts!
# all variables looked at, but one stood out right away
qplot(net$age)
# lots of 99 year olds in this survey? unlikley
# checked further and found the following variables using 8, 9 or 99 for missing values
# intmob(8), employ, par, educ2, hisp, race (9), age, inc (99)
# will exclude during chart creation process
# Begin deeper dive: understand who is and who is not using Facebook
# trying both mosaic and bar charts
# Not color blind friendly, but I like the ggplot color palette
# find hex codes to match mosaic charts to ggplot charts
require(ggplot2)
n <- 2
hcl(h=seq(15, 375-360/n, length=n)%%360, c=100, l=65)
# output: "#F8766D" "#00BFC4"; will use these in mosaic plots for consistency b/w charts
# Understanding Gender
mosaic( ~ sex + facebook_user, data = net,
labeling_args = list(set_varnames = c(sex = "", facebook_user = "Facebook Usage")),
highlighting = "facebook_user",
highlighting_fill = c("#F8766D","#00BFC4"),
rot_labels = c(left = 0, top = 0),
pos_labels = c("center","center"),
offset_labels = c(0.0,0.6))
dev.off() # close the pdf graphics file
p <- ggplot(net, aes(x=sex, fill=facebook_user)) +
geom_bar(position="dodge")
p2 <- p + ggtitle("Gender of Facebook Users") +
labs(fill="Facebook User") +
xlab("Title") + # for when I want to change x axis labels
ylab("Title") + # for when I want to change y axis labels
theme(axis.title.x=element_blank()) + # for when I want to exclude x axis labels
theme(axis.title.y=element_blank()) # for when I want to exclude y axis labels
pdf(file = "plot_gender.pdf", width = 11, height = 8.5)
print(p2)
dev.off()
# Understanding Ethnicity
# exclude NAs
newRace <- net[ which(net$race!=9), ]
p <- ggplot(newRace, aes(x=race, fill=facebook_user)) +
geom_bar(position="dodge")
p + ggtitle("Race of Facebook Users") +
labs(fill="Facebook User") +
xlab("Title") + # for when I want to change x axis labels
ylab("Title") + # for when I want to change y axis labels
theme(axis.title.x=element_blank()) + # for when I want to exclude x axis labels
theme(axis.title.y=element_blank()) + # for when I want to exclude y axis labels
scale_x_continuous(breaks=c(1, 2, 3, 4, 5, 6),
labels=c("White", "African\nAmerican", "Asian",
"Mixed", "Native\nAmerican", "Other"))
# this needs to be a proportional (100% stacked) bar chart to understand the differences
# Understanding income
# exclude NAs for income
newInc <- net[ which(net$inc!=99), ]
mosaic( ~ inc + facebook_user, data = newInc,
labeling_args = list(set_varnames = c(inc = "", facebook_user = "Facebook Usage")),
highlighting = "facebook_user",
highlighting_fill = c("#F8766D","#00BFC4"),
rot_labels = c(left = 0, top = 0),
pos_labels = c("center","center"),
offset_labels = c(0.0,0.6))
dev.off() # close the pdf graphics file
p <- ggplot(newInc, aes(x=inc, fill=facebook_user)) +
geom_bar(position="dodge")
p + ggtitle("Facebook Users and Non-Users by Income") +
labs(fill="Facebook User") +
xlab("Title") + # for when I want to change x axis labels
ylab("Title") + # for when I want to change y axis labels
theme(axis.title.x=element_blank()) + # for when I want to exclude x axis labels
theme(axis.title.y=element_blank()) + # for when I want to exclude y axis labels
scale_x_continuous(breaks=c(1, 2, 3, 4, 5, 6, 7, 8, 9),
labels=c("<10K", "<20K", "<30K", "<40K", "<50K", "<75K", "<100K", "<150K", ">150K"))
# school
# exclude NA
newEduc2 <- net[ which(net$educ2!=9), ]
mosaic( ~ educ2 + facebook_user, data = newEduc2,
labeling_args = list(set_varnames = c(neweduc2 = "Education Level", facebook_user = "Facebook Usage")),
highlighting = "facebook_user",
highlighting_fill = c("#F8766D","#00BFC4"),
rot_labels = c(left = 0, top = 0),
pos_labels = c("center","center"),
offset_labels = c(0.0,0.6))
dev.off() # close the pdf graphics file
p <- ggplot(net, aes(x=educ2, fill=facebook_user)) +
geom_bar(position="dodge")
p + ggtitle("Facebook Users and Non-Users by Education") +
labs(fill="Facebook User") +
xlab("Title") + # for when I want to change x axis labels
ylab("Title") + # for when I want to change y axis labels
theme(axis.title.x=element_blank()) + # for when I want to exclude x axis labels
theme(axis.title.y=element_blank()) + # for when I want to exclude y axis labels
scale_x_continuous(breaks=c(1, 2, 3, 4, 5, 6, 7, 8),
labels=c("No High School", "Some High School", "High School Grad", "Some College", "2 Year Degree", "4 Year Degree", "Some PostGrad", "PostGrad Degree"))
# Understanding Hispanic
# exclude NAs for Hispanic
newHisp <- net[ which(net$hisp!=9), ]
mosaic( ~ hisp + facebook_user, data = newHisp,
labeling_args = list(set_varnames = c(hisp = "", facebook_user = "Facebook Usage")),
highlighting = "facebook_user",
highlighting_fill = c("#F8766D","#00BFC4"),
rot_labels = c(left = 0, top = 0),
pos_labels = c("center","center"),
offset_labels = c(0.0,0.6))
dev.off() # close the pdf graphics file
ggplot(net, aes(x=hisp, fill=facebook_user)) +
geom_bar(position="dodge")
ggplot(newHisp, aes(x=factor(hisp), fill=facebook_user)) +
geom_bar(position="dodge")
# this needs to be a proportional (100% stacked) bar chart to understand the differences
# Understanding Parents
# Exclude NAs
newPar <- net[ which(net$par!=9), ]
mosaic( ~ par + facebook_user, data = newPar,
labeling_args = list(set_varnames = c(par = "", facebook_user = "Facebook Usage")),
highlighting = "facebook_user",
highlighting_fill = c("#F8766D","#00BFC4"),
rot_labels = c(left = 0, top = 0),
pos_labels = c("center","center"),
offset_labels = c(0.0,0.6))
dev.off() # close the pdf graphics file
ggplot(newPar, aes(x=factor(par), fill=facebook_user)) +
geom_bar(position="dodge")
# Understanding Employed
newEmploy <- net[ which(net$employ!=9), ]
newEmploy
mosaic( ~ employ + facebook_user, data = net,
labeling_args = list(set_varnames = c(employ = "", facebook_user = "Facebook Usage")),
highlighting = "facebook_user",
highlighting_fill = c("#F8766D","#00BFC4"),
rot_labels = c(left = 0, top = 0),
pos_labels = c("center","center"),
offset_labels = c(0.0,0.6))
dev.off() # close the pdf graphics file
ggplot(net, aes(x=employ, fill=facebook_user)) +
geom_bar(position="dodge")
ggplot(newEmploy, aes(x=factor(employ), fill=facebook_user)) +
geom_bar(position="dodge")
# should also be changed to % for better viz
# Understanding mobile
# Exclude NAs
newIntmob <- net[ which(net$intmob!=8), ]
mosaic( ~ intmob + facebook_user, data = newIntmob,
labeling_args = list(set_varnames = c(intmob = "", facebook_user = "Facebook Usage")),
highlighting = "facebook_user",
highlighting_fill = c("#F8766D","#00BFC4"),
rot_labels = c(left = 0, top = 0),
pos_labels = c("center","center"),
offset_labels = c(0.0,0.6))
dev.off() # close the pdf graphics file
ggplot(net, aes(x=intmob, fill=facebook_user)) +
geom_bar(position="dodge")
ggplot(newIntmob, aes(x=factor(intmob), fill=facebook_user)) +
geom_bar(position="dodge")
|
bb19722d63160769bd15a429686495fe7dcdffa6
|
e9b6775d1886f4bd869f3d490bc661f223557b85
|
/R/mutate_model_output.R
|
ca1d4a0de97ea1dfefa94be3d35cb714b58b82e7
|
[] |
no_license
|
wimmyteam/conisi
|
e1f6cff69704cd1f743652c2119a8a3ff880f6b0
|
ddf801cce4dd491de44e176b909811f804f35d1d
|
refs/heads/master
| 2023-09-03T15:51:05.858830
| 2021-10-29T18:32:32
| 2021-10-29T18:32:32
| 325,935,919
| 0
| 0
| null | 2021-04-30T21:59:02
| 2021-01-01T07:28:12
|
R
|
UTF-8
|
R
| false
| false
| 28,327
|
r
|
mutate_model_output.R
|
#' This function processes the model output
#' and creates new variables that are needed for metrics of interest. The
#' output from this function is another dataframe / tibble.
#'
#' @param df Dataframe Output from COVIDmodel. The input data frame must have a row that represents
#' each experiment and
#' time point within the experiment. The columns must contain the parameter combinations that
#' were used for each experiment and time point, as well as basic model output showing
#' the numbers in each compartment at a given time.
#' @param pop_size Integer The size of the modeled population
#'
#' @param start_date Date This is the start date for the local epidemic and it is used for adding a
#' date column to the output.
#'
#' @param report_lag Integer This is the number of days we assume pass between the infection and
#' when it is first reported.
#'
#' @param pop_prop Vector This vector contains population proportions for sub-populations
#'
#' @export
#'
#' @importFrom magrittr %>%
mutate_model_output <- function(df, pop_size, start_date = NULL, report_lag = 0, pop_prop) {
# used the calculate fractions without creating NaN values.
# return NA for 0/0
fraction <- function(a, b)
{
ifelse(b > 1e-10, a/b, NA)
}
# Do we need to create a date variable
if(!is.null(start_date)){
df <- df %>%
dplyr::mutate(date = start_date + time + report_lag)
}
# Create vars that apply to each row
df1 <- df %>%
dplyr::mutate(r_2d = r_2u,
r_md = r_mu,
c_12d = c_12u,
c_1md = c_1mu,
c_1sd = c_1su,
eta_d = eta_u,
delta_sd = delta_su,
b_a = 0,
d_e = 0,
alpha_2 = a_2d * d_2 + a_2u * r_2d,
alpha_m = a_md * d_m + 1 * r_md,
chi_e = c_e1u + d_e,
chi_u = c_12u + c_1mu + c_1su + d_1,
chi_d = c_12d + c_1md + c_1sd,
xi_2 = r_2u + d_2,
xi_m = r_mu + d_m,
zeta_u = eta_u + d_s + delta_su,
zeta_d = eta_d + delta_sd,
K = a_sd * c_1sd * c_e1u * d_1 * r_2d * r_md + a_sd * c_1sd * d_e * r_2d * r_md * chi_u,
psi = a_1d * r_2d * r_md + a_2d * c_12d * r_md + a_md * c_1md * r_2d,
G = a_1d * d_1 * r_2d * r_md + a_1u * chi_d * r_2d * r_md + a_2d * c_12d * d_1 * r_md + a_md * c_1md * d_1 * r_2d,
# A = ((((d_e * psi * chi_u + c_e1u * G) * zeta_u +
# a_su * c_1su * c_e1u * chi_d * r_2d * r_md) * zeta_d +
# K * zeta_u + a_sd * c_1su * c_e1u * chi_d * d_s * r_2d * r_md) * xi_m +
# c_e1u * c_1mu * r_2d * alpha_m * chi_d * zeta_u * zeta_d) * xi_2 +
# c_e1u * c_12u * r_md * alpha_2 * chi_d * xi_m * zeta_u * zeta_d,
#B = r_2d * r_md * chi_e * chi_u * chi_d * xi_2 * xi_m * zeta_u * zeta_d,
#R0 = (b_a + b_b) * A / B,
#Reff = FOIadjust * R0 * (S / pop_size),
AllInfections1 = E_u1 + I_1u1 + I_2u1 + I_mu1 + I_su1 + E_d1 + I_1d1 + I_2d1 + I_md1 + I_sd1 + H1 + P1 + C1,
AllInfections2 = E_u2 + I_1u2 + I_2u2 + I_mu2 + I_su2 + E_d2 + I_1d2 + I_2d2 + I_md2 + I_sd2 + H2 + P2 + C2,
AllInfections3 = E_u3 + I_1u3 + I_2u3 + I_mu3 + I_su3 + E_d3 + I_1d3 + I_2d3 + I_md3 + I_sd3 + H3 + P3 + C3,
AllInfections = AllInfections1 + AllInfections2 + AllInfections3,
ActiveInfections1 = I_1u1 + I_2u1 + I_mu1 + I_su1 + I_1d1 + I_2d1 + I_md1 + I_sd1,
ActiveInfections2 = I_1u2 + I_2u2 + I_mu2 + I_su2 + I_1d2 + I_2d2 + I_md2 + I_sd2,
ActiveInfections3 = I_1u3 + I_2u3 + I_mu3 + I_su3 + I_1d3 + I_2d3 + I_md3 + I_sd3,
ActiveInfections = ActiveInfections1 + ActiveInfections2 + ActiveInfections3,
SymptKnownAsymptInfections1 = I_mu1 + I_su1 + I_1d1 + I_2d1 + I_md1 + I_sd1,
SymptKnownAsymptInfections2 = I_mu2 + I_su2 + I_1d2 + I_2d2 + I_md2 + I_sd2,
SymptKnownAsymptInfections3 = I_mu3 + I_su3 + I_1d3 + I_2d3 + I_md3 + I_sd3,
SymptKnownAsymptInfections = SymptKnownAsymptInfections1 + SymptKnownAsymptInfections2 + SymptKnownAsymptInfections3,
SymptKnownInfections1 = I_md1 + I_sd1,
SymptKnownInfections2 = I_md2 + I_sd2,
SymptKnownInfections3 = I_md3 + I_sd3,
SymptKnownInfections = SymptKnownInfections1 + SymptKnownInfections2 + SymptKnownInfections3,
SymptUnknownInfections1 = I_mu1 + I_su1,
SymptUnknownInfections2 = I_mu2 + I_su2,
SymptUnknownInfections3 = I_mu3 + I_su3,
SymptUnknownInfections = SymptUnknownInfections1 + SymptUnknownInfections2 + SymptUnknownInfections3,
AsymptKnownInfections1 = I_1d1 + I_2d1,
AsymptKnownInfections2 = I_1d2 + I_2d2,
AsymptKnownInfections3 = I_1d3 + I_2d3,
AsymptKnownInfections = AsymptKnownInfections1 + AsymptKnownInfections2 + AsymptKnownInfections3,
AsymptUnknownInfections1 = I_1u1 + I_2u1,
AsymptUnknownInfections2 = I_1u2 + I_2u2,
AsymptUnknownInfections3 = I_1u3 + I_2u3,
AsymptUnknownInfections = AsymptUnknownInfections1 + AsymptUnknownInfections2 + AsymptUnknownInfections3,
SymptInfections1 = I_mu1 + I_md1 + I_su1 + I_sd1,
SymptInfections2 = I_mu2 + I_md2 + I_su2 + I_sd2,
SymptInfections3 = I_mu3 + I_md3 + I_su3 + I_sd3,
SymptInfections = SymptInfections1 + SymptInfections2 + SymptInfections3,
AsymptInfections1 = I_1u1 + I_2u1 + I_1d1 + I_2d1,
AsymptInfections2 = I_1u2 + I_2u2 + I_1d2 + I_2d2,
AsymptInfections3 = I_1u3 + I_2u3 + I_1d3 + I_2d3,
AsymptInfections = AsymptInfections1 + AsymptInfections2 + AsymptInfections3,
KnownInfections1 = I_1d1 + I_2d1 + I_md1 + I_sd1,
KnownInfections2 = I_1d2 + I_2d2 + I_md2 + I_sd2,
KnownInfections3 = I_1d3 + I_2d3 + I_md3 + I_sd3,
KnownInfections = KnownInfections1 + KnownInfections2 + KnownInfections3,
UnknownInfections1 = I_1u1 + I_2u1 + I_mu1 + I_su1,
UnknownInfections2 = I_1u2 + I_2u2 + I_mu2 + I_su2,
UnknownInfections3 = I_1u3 + I_2u3 + I_mu3 + I_su3,
UnknownInfections = UnknownInfections1 + UnknownInfections2 + UnknownInfections3,
SevereKnownMildInfections1 = I_sd1 + I_su1 + I_md1,
SevereKnownMildInfections2 = I_sd2 + I_su2 + I_md2,
SevereKnownMildInfections3 = I_sd3 + I_su3 + I_md3,
SevereKnownMildInfections = SevereKnownMildInfections1 + SevereKnownMildInfections2 + SevereKnownMildInfections3,
SevereInfections1 = I_sd1 + I_su1,
SevereInfections2 = I_sd2 + I_su2,
SevereInfections3 = I_sd3 + I_su3,
SevereInfections = SevereInfections1 + SevereInfections2 + SevereInfections3,
Hospitalizations1 = H1 + P1 + C1,
Hospitalizations2 = H2 + P2 + C2,
Hospitalizations3 = H3 + P3 + C3,
Hospitalizations = Hospitalizations1 + Hospitalizations2 + Hospitalizations3,
Hosp_I_sd1 = I_sd1 + Hospitalizations1,
Hosp_I_sd2 = I_sd2 + Hospitalizations2,
Hosp_I_sd3 = I_sd3 + Hospitalizations3,
Hosp_I_sd = Hosp_I_sd1 + Hosp_I_sd2 + Hosp_I_sd3,
Hosp_SevereInfections1 = SevereInfections1 + Hospitalizations1,
Hosp_SevereInfections2 = SevereInfections2 + Hospitalizations2,
Hosp_SevereInfections3 = SevereInfections3 + Hospitalizations3,
Hosp_SevereInfections = Hosp_SevereInfections1 + Hosp_SevereInfections2 + Hosp_SevereInfections3,
Hosp_SevereKnownMildInfections1 = SevereKnownMildInfections1 + Hospitalizations1,
Hosp_SevereKnownMildInfections2 = SevereKnownMildInfections2 + Hospitalizations2,
Hosp_SevereKnownMildInfections3 = SevereKnownMildInfections3 + Hospitalizations3,
Hosp_SevereKnownMildInfections = Hosp_SevereKnownMildInfections1 + Hosp_SevereKnownMildInfections2 + Hosp_SevereKnownMildInfections3,
Hosp_SymptInfections1 = SymptInfections1 + Hospitalizations1,
Hosp_SymptInfections2 = SymptInfections2 + Hospitalizations2,
Hosp_SymptInfections3 = SymptInfections3 + Hospitalizations3,
Hosp_SymptInfections = Hosp_SymptInfections1 + Hosp_SymptInfections2 + Hosp_SymptInfections3,
Hosp_SymptKnownAsymptInfections1 = SymptKnownAsymptInfections1 + Hospitalizations1,
Hosp_SymptKnownAsymptInfections2 = SymptKnownAsymptInfections2 + Hospitalizations2,
Hosp_SymptKnownAsymptInfections3 = SymptKnownAsymptInfections3 + Hospitalizations3,
Hosp_SymptKnownAsymptInfections = Hosp_SymptKnownAsymptInfections1 + Hosp_SymptKnownAsymptInfections2 + Hosp_SymptKnownAsymptInfections3,
Hosp_ActiveInfections1 = ActiveInfections1 + Hospitalizations1,
Hosp_ActiveInfections2 = ActiveInfections2 + Hospitalizations2,
Hosp_ActiveInfections3 = ActiveInfections3 + Hospitalizations3,
Hosp_ActiveInfections = Hosp_ActiveInfections1 + Hosp_ActiveInfections2 + Hosp_ActiveInfections3,
Hosp_SymptKnownInfections1 = SymptKnownInfections1 + Hospitalizations1,
Hosp_SymptKnownInfections2 = SymptKnownInfections2 + Hospitalizations2,
Hosp_SymptKnownInfections3 = SymptKnownInfections3 + Hospitalizations3,
Hosp_SymptKnownInfections = Hosp_SymptKnownInfections1 + Hosp_SymptKnownInfections2 + Hosp_SymptKnownInfections3,
hosp_nonicu1 = H1 + P1,
hosp_nonicu2 = H2 + P2,
hosp_nonicu3 = H3 + P3,
hosp_nonicu = hosp_nonicu1 + hosp_nonicu2 + hosp_nonicu3,
deaths_hosp1 = D_h1 + D_c1,
deaths_hosp2 = D_h2 + D_c2,
deaths_hosp3 = D_h3 + D_c3,
deaths_hosp = deaths_hosp1 + deaths_hosp2 + deaths_hosp3,
NotWorking1 = KnownInfections1 + Hospitalizations1,
NotWorking2 = KnownInfections2 + Hospitalizations2,
NotWorking3 = KnownInfections3 + Hospitalizations3,
NotWorking = NotWorking1 + NotWorking2 + NotWorking3,
ReturnWork_cumul_flow1 = R_2d1 + R_md1 + R_c1 + R_h1,
ReturnWork_cumul_flow2 = R_2d2 + R_md2 + R_c2 + R_h2,
ReturnWork_cumul_flow3 = R_2d3 + R_md3 + R_c3 + R_h3,
ReturnWork_cumul_flow = ReturnWork_cumul_flow1 + ReturnWork_cumul_flow2 + ReturnWork_cumul_flow3,
AllDeaths1 = D_s1 + D_h1 + D_c1,
AllDeaths2 = D_s2 + D_h2 + D_c2,
AllDeaths3 = D_s3 + D_h3 + D_c3,
AllDeaths = AllDeaths1 + AllDeaths2 + AllDeaths3,
ContribAll = ContribAll1 + ContribAll2 + ContribAll3,
ContribNonSympt = ContribNonSympt1 + ContribNonSympt2 + ContribNonSympt3,
ConfirmedCases = ConfirmedCases1 + ConfirmedCases2 + ConfirmedCases3,
eta_d_cumul_flow = eta_d_cumul_flow1 + eta_d_cumul_flow2 + eta_d_cumul_flow3,
eta_u_cumul_flow = eta_u_cumul_flow1 + eta_u_cumul_flow2 + eta_u_cumul_flow3,
r_h_cumul_flow = r_h_cumul_flow1 + r_h_cumul_flow2 + r_h_cumul_flow3,
delta_h_cumul_flow = delta_h_cumul_flow1 + delta_h_cumul_flow2 + delta_h_cumul_flow3,
theta_cumul_flow = theta_cumul_flow1 + theta_cumul_flow2 + theta_cumul_flow3,
Symp_diagnozed_cumul_flow = Symp_diagnozed_cumul_flow1 + Symp_diagnozed_cumul_flow2 + Symp_diagnozed_cumul_flow3,
Asymp_diagnozed_cumul_flow = Asymp_diagnozed_cumul_flow1 + Asymp_diagnozed_cumul_flow2 + Asymp_diagnozed_cumul_flow3,
Symp_inf_cumul_flow = Symp_inf_cumul_flow1 + Symp_inf_cumul_flow2 + Symp_inf_cumul_flow3,
ReturnWork_cumul_flow = ReturnWork_cumul_flow1 + ReturnWork_cumul_flow2 + ReturnWork_cumul_flow3,
H = H1 + H2 + H3,
P = P1 + P2 + P3,
C = C1 + C2 + C3,
I_sd = I_sd1 + I_sd2 + I_sd3,
AllVaccinations1 = Vaccination_dose1_flow1 + Vaccination_fully_flow1,
AllVaccinations2 = Vaccination_dose1_flow2 + Vaccination_fully_flow2,
AllVaccinations3 = Vaccination_dose1_flow3 + Vaccination_fully_flow3,
AllVaccinations = AllVaccinations1 + AllVaccinations2 + AllVaccinations3,
Dose1Vaccinated = Vaccination_dose1_flow1 + Vaccination_dose1_flow2 + Vaccination_dose1_flow3,
FullyVaccinated = Vaccination_fully_flow1 + Vaccination_fully_flow2 + Vaccination_fully_flow3,
Prevalence1 = ActiveInfections1 / (pop_prop[1] * pop_size),
Prevalence2 = ActiveInfections2 / (pop_prop[2] * pop_size),
Prevalence3 = ActiveInfections3 / (pop_prop[3] * pop_size),
Prevalence = ActiveInfections / pop_size,
Exposure1 = ContribAll1 / (pop_prop[1] * pop_size),
Exposure2 = ContribAll2 / (pop_prop[2] * pop_size),
Exposure3 = ContribAll3 / (pop_prop[3] * pop_size),
Exposure = ContribAll / pop_size,
Susceptible1 = S1 / (pop_prop[1] * pop_size),
Susceptible2 = S2 / (pop_prop[2] * pop_size),
Susceptible3 = S3 / (pop_prop[3] * pop_size),
Susceptible = (S1 + S2 + S3) / pop_size,
FracSymptKnown1 = fraction(SymptKnownInfections1, ActiveInfections1),
FracSymptKnown2 = fraction(SymptKnownInfections2, ActiveInfections2),
FracSymptKnown3 = fraction(SymptKnownInfections3, ActiveInfections3),
FracSymptKnown = fraction(SymptKnownInfections, ActiveInfections),
FracSymptUnknown1 = fraction(SymptUnknownInfections1, ActiveInfections1),
FracSymptUnknown2 = fraction(SymptUnknownInfections2, ActiveInfections2),
FracSymptUnknown3 = fraction(SymptUnknownInfections3, ActiveInfections3),
FracSymptUnknown = fraction(SymptUnknownInfections, ActiveInfections),
FracAsymptKnown1 = fraction(AsymptKnownInfections1, ActiveInfections1),
FracAsymptKnown2 = fraction(AsymptKnownInfections2, ActiveInfections2),
FracAsymptKnown3 = fraction(AsymptKnownInfections3, ActiveInfections3),
FracAsymptKnown = fraction(AsymptKnownInfections, ActiveInfections),
FracAsymptUnknown1 = fraction(AsymptUnknownInfections1, ActiveInfections1),
FracAsymptUnknown2 = fraction(AsymptUnknownInfections2, ActiveInfections2),
FracAsymptUnknown3 = fraction(AsymptUnknownInfections3, ActiveInfections3),
FracAsymptUnknown = fraction(AsymptUnknownInfections, ActiveInfections),
FracHospSymptKnown1 = fraction(Hosp_SymptKnownInfections1, Hosp_SymptInfections1),
FracHospSymptKnown2 = fraction(Hosp_SymptKnownInfections2, Hosp_SymptInfections2),
FracHospSymptKnown3 = fraction(Hosp_SymptKnownInfections3, Hosp_SymptInfections3),
FracHospSymptKnown = fraction(Hosp_SymptKnownInfections, Hosp_SymptInfections),
idf1 = fraction(KnownInfections1 + H1 + P1 + C1, ActiveInfections1 + H1 + P1 + C1),
idf2 = fraction(KnownInfections2 + H2 + P2 + C2, ActiveInfections2 + H2 + P2 + C2),
idf3 = fraction(KnownInfections3 + H3 + P3 + C3, ActiveInfections3 + H3 + P3 + C3),
idf = fraction(KnownInfections + H + P + C, ActiveInfections + H + P + C),
ifr1 = fraction(AllDeaths1, ContribAll1),
ifr2 = fraction(AllDeaths2, ContribAll2),
ifr3 = fraction(AllDeaths3, ContribAll3),
ifr = fraction(AllDeaths, ContribAll), # All deaths at a point in time / Cumulative Incidence (all people who have been infected)
cfr1 = fraction(AllDeaths1, ConfirmedCases1), # Cum deaths at a point in time / all cumulative detected cases
cfr2 = fraction(AllDeaths2, ConfirmedCases2),
cfr3 = fraction(AllDeaths3, ConfirmedCases3),
cfr = fraction(AllDeaths, ConfirmedCases))
# Create vars that apply to each experiment
df2 <- df1 %>%
dplyr::arrange(experiment, time) %>%
dplyr::group_by(experiment) %>%
dplyr::mutate(AllDailyInfections1 = ContribAll1 - dplyr::lag(ContribAll1, default = 0),
AllDailyInfections2 = ContribAll2 - dplyr::lag(ContribAll2, default = 0),
AllDailyInfections3 = ContribAll3 - dplyr::lag(ContribAll3, default = 0),
AllDailyInfections = ContribAll - dplyr::lag(ContribAll, default = 0),
NonSymptDailyInfections1 = ContribNonSympt1 - dplyr::lag(ContribNonSympt1, default = 0),
NonSymptDailyInfections2 = ContribNonSympt2 - dplyr::lag(ContribNonSympt2, default = 0),
NonSymptDailyInfections3 = ContribNonSympt3 - dplyr::lag(ContribNonSympt3, default = 0),
NonSymptDailyInfections = ContribNonSympt - dplyr::lag(ContribNonSympt, default = 0),
RelContribNonSympt1 = fraction(NonSymptDailyInfections1, AllDailyInfections1),
RelContribNonSympt2 = fraction(NonSymptDailyInfections2, AllDailyInfections2),
RelContribNonSympt3 = fraction(NonSymptDailyInfections3, AllDailyInfections3),
RelContribNonSympt = fraction(NonSymptDailyInfections, AllDailyInfections),
NewCases1 = ConfirmedCases1 - dplyr::lag(ConfirmedCases1, default = 0),
NewCases2 = ConfirmedCases2 - dplyr::lag(ConfirmedCases2, default = 0),
NewCases3 = ConfirmedCases3 - dplyr::lag(ConfirmedCases3, default = 0),
NewCases = ConfirmedCases - dplyr::lag(ConfirmedCases, default = 0),
NewDeaths1 = AllDeaths1 - dplyr::lag(AllDeaths1, default = 0),
NewDeaths2 = AllDeaths2 - dplyr::lag(AllDeaths2, default = 0),
NewDeaths3 = AllDeaths3 - dplyr::lag(AllDeaths3, default = 0),
NewDeaths = AllDeaths - dplyr::lag(AllDeaths, default = 0),
NewVaccinations1 = AllVaccinations1 - dplyr::lag(AllVaccinations1, default = 0),
NewVaccinations2 = AllVaccinations2 - dplyr::lag(AllVaccinations2, default = 0),
NewVaccinations3 = AllVaccinations3 - dplyr::lag(AllVaccinations3, default = 0),
NewVaccinations = AllVaccinations - dplyr::lag(AllVaccinations, default = 0),
NewDose1Vaccinated = Dose1Vaccinated - dplyr::lag(Dose1Vaccinated, default = 0),
NewFullyVaccinated = FullyVaccinated - dplyr::lag(FullyVaccinated, default = 0),
eta_d_flow1 = eta_d_cumul_flow1 - dplyr::lag(eta_d_cumul_flow1, default = 0),
eta_d_flow2 = eta_d_cumul_flow2 - dplyr::lag(eta_d_cumul_flow2, default = 0),
eta_d_flow3 = eta_d_cumul_flow3 - dplyr::lag(eta_d_cumul_flow3, default = 0),
eta_d_flow = eta_d_cumul_flow - dplyr::lag(eta_d_cumul_flow, default = 0),
eta_u_flow1 = eta_u_cumul_flow1 - dplyr::lag(eta_u_cumul_flow1, default = 0),
eta_u_flow2 = eta_u_cumul_flow2 - dplyr::lag(eta_u_cumul_flow2, default = 0),
eta_u_flow3 = eta_u_cumul_flow3 - dplyr::lag(eta_u_cumul_flow3, default = 0),
eta_u_flow = eta_u_cumul_flow - dplyr::lag(eta_u_cumul_flow, default = 0),
r_h_flow1 = r_h_cumul_flow1 - dplyr::lag(r_h_cumul_flow1, default = 0),
r_h_flow2 = r_h_cumul_flow2 - dplyr::lag(r_h_cumul_flow2, default = 0),
r_h_flow3 = r_h_cumul_flow3 - dplyr::lag(r_h_cumul_flow3, default = 0),
r_h_flow = r_h_cumul_flow - dplyr::lag(r_h_cumul_flow, default = 0),
delta_h_flow1 = delta_h_cumul_flow1 - dplyr::lag(delta_h_cumul_flow1, default = 0),
delta_h_flow2 = delta_h_cumul_flow2 - dplyr::lag(delta_h_cumul_flow2, default = 0),
delta_h_flow3 = delta_h_cumul_flow3 - dplyr::lag(delta_h_cumul_flow3, default = 0),
delta_h_flow = delta_h_cumul_flow - dplyr::lag(delta_h_cumul_flow, default = 0),
theta_flow1 = theta_cumul_flow1 - dplyr::lag(theta_cumul_flow1, default = 0),
theta_flow2 = theta_cumul_flow2 - dplyr::lag(theta_cumul_flow2, default = 0),
theta_flow3 = theta_cumul_flow3 - dplyr::lag(theta_cumul_flow3, default = 0),
theta_flow = theta_cumul_flow - dplyr::lag(theta_cumul_flow, default = 0),
Symp_diagnozed_flow1 = Symp_diagnozed_cumul_flow1 - dplyr::lag(Symp_diagnozed_cumul_flow1, default = 0),
Symp_diagnozed_flow2 = Symp_diagnozed_cumul_flow2 - dplyr::lag(Symp_diagnozed_cumul_flow2, default = 0),
Symp_diagnozed_flow3 = Symp_diagnozed_cumul_flow3 - dplyr::lag(Symp_diagnozed_cumul_flow3, default = 0),
Symp_diagnozed_flow = Symp_diagnozed_cumul_flow - dplyr::lag(Symp_diagnozed_cumul_flow, default = 0),
Asymp_diagnozed_flow1 = Asymp_diagnozed_cumul_flow1 - dplyr::lag(Asymp_diagnozed_cumul_flow1, default = 0),
Asymp_diagnozed_flow2 = Asymp_diagnozed_cumul_flow2 - dplyr::lag(Asymp_diagnozed_cumul_flow2, default = 0),
Asymp_diagnozed_flow3 = Asymp_diagnozed_cumul_flow3 - dplyr::lag(Asymp_diagnozed_cumul_flow3, default = 0),
Asymp_diagnozed_flow = Asymp_diagnozed_cumul_flow - dplyr::lag(Asymp_diagnozed_cumul_flow, default = 0),
Symp_inf_flow1 = Symp_inf_cumul_flow1 - dplyr::lag(Symp_inf_cumul_flow1, default = 0),
Symp_inf_flow2 = Symp_inf_cumul_flow2 - dplyr::lag(Symp_inf_cumul_flow2, default = 0),
Symp_inf_flow3 = Symp_inf_cumul_flow3 - dplyr::lag(Symp_inf_cumul_flow3, default = 0),
Symp_inf_flow = Symp_inf_cumul_flow - dplyr::lag(Symp_inf_cumul_flow, default = 0),
ReturnWork_flow1 = ReturnWork_cumul_flow1 - dplyr::lag(ReturnWork_cumul_flow1, default = 0),
ReturnWork_flow2 = ReturnWork_cumul_flow2 - dplyr::lag(ReturnWork_cumul_flow2, default = 0),
ReturnWork_flow3 = ReturnWork_cumul_flow3 - dplyr::lag(ReturnWork_cumul_flow3, default = 0),
ReturnWork_flow = ReturnWork_cumul_flow - dplyr::lag(ReturnWork_cumul_flow, default = 0))
# Create vars that apply to each time point, by summarized by experiment
df3 <- df2 %>%
dplyr::group_by(time) %>%
dplyr::mutate(dplyr::across(.cols = c(ConfirmedCases, ConfirmedCases1, ConfirmedCases2, ConfirmedCases3,
NewCases, NewCases1, NewCases2, NewCases3,
ActiveInfections, ActiveInfections1, ActiveInfections2, ActiveInfections3,
Prevalence, Prevalence1, Prevalence2, Prevalence3,
Exposure, Exposure1, Exposure2, Exposure3,
Susceptible, Susceptible1, Susceptible2, Susceptible3,
SevereInfections, SevereInfections1, SevereInfections2, SevereInfections3,
I_sd, I_sd1, I_sd2, I_sd3,
Hospitalizations, Hospitalizations1, Hospitalizations2, Hospitalizations3,
C, C1, C2, C3,
SymptInfections, SymptInfections1, SymptInfections2, SymptInfections3,
AsymptInfections, AsymptInfections1, AsymptInfections2, AsymptInfections3,
NotWorking, NotWorking1, NotWorking2, NotWorking3,
KnownInfections, KnownInfections1, KnownInfections2, KnownInfections3,
SymptKnownInfections, SymptKnownInfections1, SymptKnownInfections2, SymptKnownInfections3,
AsymptKnownInfections, AsymptKnownInfections1, AsymptKnownInfections2, AsymptKnownInfections3,
AllDeaths, AllDeaths1, AllDeaths2, AllDeaths3,
NewDeaths, NewDeaths1, NewDeaths2, NewDeaths3,
NewVaccinations, NewVaccinations1, NewVaccinations2, NewVaccinations3,
FullyVaccinated, Dose1Vaccinated,
NewDose1Vaccinated,
NewFullyVaccinated,
AllVaccinations, AllVaccinations1, AllVaccinations2, AllVaccinations3,
Hosp_I_sd, Hosp_I_sd1, Hosp_I_sd2, Hosp_I_sd3,
Hosp_SevereInfections, Hosp_SevereInfections1, Hosp_SevereInfections2, Hosp_SevereInfections3,
Hosp_SevereKnownMildInfections, Hosp_SevereKnownMildInfections1, Hosp_SevereKnownMildInfections2, Hosp_SevereKnownMildInfections3,
Hosp_SymptInfections, Hosp_SymptInfections1, Hosp_SymptInfections2, Hosp_SymptInfections3,
Hosp_SymptKnownAsymptInfections, Hosp_SymptKnownAsymptInfections1, Hosp_SymptKnownAsymptInfections2, Hosp_SymptKnownAsymptInfections3,
Hosp_ActiveInfections, Hosp_ActiveInfections1, Hosp_ActiveInfections2, Hosp_ActiveInfections3,
Hosp_SymptKnownInfections, Hosp_SymptKnownInfections1, Hosp_SymptKnownInfections2, Hosp_SymptKnownInfections3,
hosp_nonicu, hosp_nonicu1, hosp_nonicu2, hosp_nonicu3,
deaths_hosp, deaths_hosp1, deaths_hosp2, deaths_hosp3,
eta_d_flow, eta_d_flow1, eta_d_flow2, eta_d_flow2,
eta_u_flow, eta_u_flow1, eta_u_flow2, eta_u_flow3,
r_h_flow, r_h_flow1, r_h_flow2, r_h_flow3,
delta_h_flow, delta_h_flow1, delta_h_flow2, delta_h_flow3,
theta_flow, theta_flow1, theta_flow2, theta_flow3,
Symp_diagnozed_flow, Symp_diagnozed_flow1, Symp_diagnozed_flow2, Symp_diagnozed_flow3,
Asymp_diagnozed_flow, Asymp_diagnozed_flow1, Asymp_diagnozed_flow2, Asymp_diagnozed_flow3,
Symp_inf_flow, Symp_inf_flow1, Symp_inf_flow2, Symp_inf_flow3,
ReturnWork_flow, ReturnWork_flow1, ReturnWork_flow2, ReturnWork_flow3),
.fns = list(mean = mean, min = min, max = max),
.names = "{col}_{fn}")) %>%
dplyr::ungroup()
#Prepend parameters with a "par_"
df4 <- df3 %>%
dplyr::rename_with(function(x){paste0("par_", x)}, a_1d:upsilon | r_2d:d_e)
return(df4)
}
|
a7bf0e4fceb8cf715efd3acfc11c453e5ea7ae60
|
abdcc6ac44877fc30de16c49c3b590d9d5fccb31
|
/man/grid_at.Rd
|
7648d8984333b9c08132d7260f1117633ed99e55
|
[] |
no_license
|
cran/cursr
|
c044e45566d03a5a9566bad732c965fd6c861e4c
|
451f1a62702217fddc11a8446958d0769af71b42
|
refs/heads/master
| 2023-02-23T21:57:44.910797
| 2021-01-11T07:50:09
| 2021-01-11T07:50:09
| 334,100,036
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| true
| 1,719
|
rd
|
grid_at.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/8-Draw.R
\name{grid_at}
\alias{grid_at}
\title{Draw a Character Grid Matrix}
\usage{
grid_at(
yx = c(1, 1),
dim = NULL,
step = c(2, 2),
text = c(".", ".", "+", "|", "|", "-", "-", rep("+", 8)),
border = TRUE
)
}
\arguments{
\item{yx}{\code{(row,column)} on screen or window where the upper-left corner of the grid is to be printed}
\item{dim}{\code{(row, column)} vector for size of grid.}
\item{step}{numeric vector describing grid step across \code{(rows, columns)}}
\item{text}{character vector of values for the grid, in order: horizontal grid line, vertical grid line, grid intersection, left border, right border, top border, bottom border, corners (upper-left, upper-right, lower-left, lower-right), ticks (right, bottom, left, top)}
\item{border}{logical value for whether a border should be included.}
}
\value{
\code{NULL}
}
\description{
Constructs a grid with given dimension, character values, and step parameter, and prints it to screen
}
\examples{
grid_at(yx=c(2,2), dim=c(11,13), step=c(2,4), border=TRUE)
}
\seealso{
Other drawing functions:
\code{\link{box_at}()},
\code{\link{draw_arc}()},
\code{\link{draw_bezier}()},
\code{\link{draw_circle}()},
\code{\link{draw_ellipse}()},
\code{\link{draw_fn}()},
\code{\link{draw_lerp}()},
\code{\link{draw_path}()},
\code{\link{draw_ray}()},
\code{\link{draw_rect}()},
\code{\link{draw_shape}()},
\code{\link{fill_circle}()},
\code{\link{fill_ellipse}()},
\code{\link{fill_rect}()},
\code{\link{fill_shape}()},
\code{\link{grid_mat}()},
\code{\link{hline_at}()},
\code{\link{hline}()},
\code{\link{vline_at}()},
\code{\link{vline}()}
}
\concept{drawing functions}
|
73ecc8f62b9c2de09a5bded6dd44b241e8d2898c
|
04f349102910e5052ea34d3e7744e4d79a2fbb4f
|
/man/pof_future_cables_20_10_04kv.Rd
|
da6a2c1bee7e1c916e6f140117d12764858b6535
|
[
"MIT"
] |
permissive
|
scoultersdcoe/CNAIM
|
f0728b00f0d0628e554975c78d767ee2c472fb3b
|
5c77ce4c50ef92fd05b9bb44b33fdca18302d020
|
refs/heads/master
| 2023-08-23T22:54:59.450292
| 2021-03-12T15:52:54
| 2021-03-12T15:52:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| true
| 3,779
|
rd
|
pof_future_cables_20_10_04kv.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pof_future_cables_20_10_04kv.R
\name{pof_future_cables_20_10_04kv}
\alias{pof_future_cables_20_10_04kv}
\title{Future Probability of Failure for 20/10/0.4kV cables}
\source{
DNO Common Network Asset Indices Methodology (CNAIM),
Health & Criticality - Version 1.1, 2017:
\url{https://www.ofgem.gov.uk/system/files/docs/2017/05/dno_common_network_asset_indices_methodology_v1.1.pdf}
}
\usage{
pof_future_cables_20_10_04kv(
hv_lv_cable_type = "10-20kV cable, PEX",
sub_division = "Aluminium sheath - Aluminium conductor",
utilisation_pct = "Default",
operating_voltage_pct = "Default",
sheath_test = "Default",
partial_discharge = "Default",
fault_hist = "Default",
reliability_factor = "Default",
age,
normal_expected_life_cable,
simulation_end_year = 100
)
}
\arguments{
\item{hv_lv_cable_type}{String.
A sting that refers to the specific asset category.
Options:
\code{hv_lv_cable_type = c("10-20kV cable, PEX","10-20kV cable, APB",
"0.4kV cable")}. The default setting is
\code{hv_lv_cable_type = "10-20kV cable, PEX"}.}
\item{sub_division}{String. Refers to material the sheath and conductor is
made of. Options:
\code{sub_division = c("Aluminium sheath - Aluminium conductor",
"Aluminium sheath - Copper conductor",
"Lead sheath - Aluminium conductor", "Lead sheath - Copper conductor")
}}
\item{utilisation_pct}{Numeric. The max percentage of utilisation
under normal operating conditions.}
\item{operating_voltage_pct}{Numeric. The ratio in percent of
operating/design voltage.}
\item{sheath_test}{String. Only applied for non pressurised cables.
Indicating the state of the sheath. Options:
\code{sheath_test = c("Pass", "Failed Minor", "Failed Major",
"Default")}. See page 141, table 168 in CNAIM (2017).}
\item{partial_discharge}{String. Only applied for non pressurised cables.
Indicating the level of partial discharge. Options:
\code{partial_discharge = c("Low", "Medium", "High",
"Default")}. See page 141, table 169 in CNAIM (2017).}
\item{fault_hist}{Numeric. Only applied for non pressurised cables.
The calculated fault rate for the cable in the period per kilometer.
A setting of \code{"No historic faults recorded"}
indicates no fault. See page 141, table 170 in CNAIM (2017).}
\item{reliability_factor}{Numeric. \code{reliability_factor}
shall have a value between 0.6 and 1.5. A setting of \code{"Default"}
sets the \code{reliability_factor} to 1.
See section 6.14 on page 69 in CNAIM (2017).}
\item{age}{Numeric. The current age in years of the cable.}
\item{normal_expected_life_cable}{Numeric. The normal expected life for the
cable type.}
\item{simulation_end_year}{Numeric. The last year of simulating probability
of failure. Default is 100.}
}
\value{
Numeric array. Future probability of failure
per annum for 33-66kV cables.
}
\description{
This function calculates the future
annual probability of failure per kilometer for a 20/10/0.4kV cable.
The function is a cubic curve that is based on
the first three terms of the Taylor series for an
exponential function. For more information about the
probability of failure function see section 6
on page 30 in CNAIM (2017).
}
\examples{
# Future probability of failure for 66kV UG Cable (Non Pressurised)
pof_10kV_pex <-
pof_future_cables_20_10_04kv(hv_lv_cable_type = "10-20kV cable, PEX",
sub_division = "Aluminium sheath - Aluminium conductor",
utilisation_pct = "Default",
operating_voltage_pct = "Default",
sheath_test = "Default",
partial_discharge = "Default",
fault_hist = "Default",
reliability_factor = "Default",
age = 15,
simulation_end_year = 100)
# Plot
plot(pof_10kV_pex$PoF * 100,
type = "line", ylab = "\%", xlab = "years",
main = "PoF per kilometre - 10-20kV cable, PEX")
}
|
94be3255a5ac1d6d4eaad145b97a63d9d90ddc37
|
fa49f283841189e4c752fafc6b62d1223fcc988c
|
/source/extract_features_GO_term_count.R
|
f7ebd76da37a7e6ed96f3f38713985eb8957493c
|
[
"MIT"
] |
permissive
|
saisaitian/MultiOme
|
60ab5016694c04939ae3bcf23586b0e7f188c18d
|
a2d8dfc074fb1a3a0470d4bb0c2c7f418493c1fc
|
refs/heads/main
| 2023-08-16T07:02:10.030944
| 2021-08-12T21:00:40
| 2021-08-12T21:00:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,641
|
r
|
extract_features_GO_term_count.R
|
#' Extracting GO term counts per gene
#' Ize Buphamalai, CeMM
#' Update: June 2021
#'
library(ontologyIndex)
data(go)
library(ontologySimilarity)
data(gene_GO_terms)
data(GO_IC)
#all_gene_names = citation_count$gene
#genes = gene_GO_terms[all_gene_names]
#genes = gene_GO_terms
#genes = genes[-which(sapply(genes, length)==0)]
bp <- go$id[go$name == "biological_process"]
genes_bp <- lapply(gene_GO_terms, function(x) intersection_with_descendants(go, roots=bp, x))
#data.frame(check.names=FALSE, `#terms`=sapply(genes, length), `#CC terms`=sapply(genes_bp, length))
mf <- go$id[go$name == "molecular_function"]
genes_mf <- lapply(gene_GO_terms, function(x) intersection_with_descendants(go, roots=mf, x))
genes_ic5 <- sapply(gene_GO_terms, function(x) sum(GO_IC[x] > 5))
GO_count_by_genes <- tibble(gene = names(gene_GO_terms),
BP_terms = sapply(genes_bp, length),
MF_terms = sapply(genes_mf, length),
AllGO_terms = sapply(gene_GO_terms, length),
Informative_GOterms = genes_ic5)
write_tsv(GO_count_by_genes, "../cache/GO_terms_count_per_gene.tsv")
# below is commented, for computing similarity matrix based on this
# define new similarity matrix by applying Resnik similarity instead of Lin, and use BMA for combining the similarity
#GO_similarity_matrix <- get_sim_grid(ontology=go, information_content=GO_IC,
# term_sets=genes_bp, term_sim_method = "resnik")
#write.csv2(GO_similarity_matrix, "./GO_similarity_mat.csv", quote = F)
#save(GO_similarity_matrix, file = "./GO_similarity_matrix_resnik.RData")
|
6c0f8bbd293783ee049f990b875de4377074608c
|
c55e7cfa88461039f69367b901c3003eb54a17a5
|
/Pricing Analysis.R
|
dcd83635cebd42f0a7177cc1108a4aab4b543b0e
|
[] |
no_license
|
yashrj73/Arline-Price-Analysis
|
5e1e69c8562ec4adea9c48f923d9f20db74d6bdf
|
a10f80801a1bf48901b6a42711159c63f99be7ef
|
refs/heads/master
| 2023-02-14T16:53:17.311690
| 2021-01-14T06:32:02
| 2021-01-14T06:32:02
| 103,805,363
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 7,060
|
r
|
Pricing Analysis.R
|
#SIX AIRLINES DATA
#Reading the data into R
SixAirlines.df <- read.csv(paste("SixAirlinesData.csv"))
#Summary statistics
summary(SixAirlines.df)
#AIRFRANCE AIRLINES
#Creating subset of AirFrance airlines
AirFrance.df <- subset(SixAirlines.df, Airline=="AirFrance")
#Summary statistics
summary(AirFrance.df)
#Formulating a regression model: y=b0+b1*x1+b2*x2+..
#where y= PriceRelative
#x1= WidthDifference, x2= PitchDifference, x3= FractionPremiumSeats, x4= FlightDuration
#x5= FlightDuration, x6= TravelMonth, x7= Aircraft
#Fitting a Linear Regression Model using lm()
fit <-lm(PriceRelative~WidthDifference+PitchDifference+FractionPremiumSeats+FlightDuration+SeatsTotal+TravelMonth+Aircraft,data= AirFrance.df)
summary(fit)
#Significant Factor(s): Fraction of Premium Seats, Flight Duration, Total Seats and Type of Aircraft
#Scatter plot of significant factors vs Relative Price:
#PriceRelative vs FractionPremiumSeats
plot(PriceRelative~FractionPremiumSeats,data = AirFrance.df,ylim = c(0,2),ylab="Relative Price")
#PriceRelative vs FlightDuration
plot(PriceRelative~FlightDuration,data = AirFrance.df,ylim = c(0,2),ylab="Relative Price")
#PriceRelative vs SeatsTotal
plot(PriceRelative~SeatsTotal,data = AirFrance.df,ylim = c(0,2),ylab="Relative Price",xlim=c(100,500))
#PriceRelative vs Aircraft
plot(PriceRelative~Aircraft,data = AirFrance.df,ylim = c(0,2),ylab="Relative Price")
#BRITISH AIRLINES
#Creating subset of British airlines
British.df <- subset(SixAirlines.df, Airline=="British")
#Summary statistics
summary(British.df)
#Formulating a regression model: y=b0+b1*x1+b2*x2+..
#where y= PriceRelative
#x1= WidthDifference, x2= PitchDifference, x3= FractionPremiumSeats, x4= FlightDuration
#x5= FlightDuration, x6= TravelMonth, x7= Aircraft
#Fitting a Linear Regression Model using lm()
fit <-lm(PriceRelative~WidthDifference+PitchDifference+FractionPremiumSeats+FlightDuration+SeatsTotal+TravelMonth+Aircraft,data= British.df)
summary(fit)
#Significant Factor(s): Flight Duration, Total Seats, Type of Aircraft.
#Scatter plot of significant factors vs Relative Price:
#PriceRelative vs FlightDuration
plot(PriceRelative~FlightDuration,data = British.df,ylim = c(0,2),ylab="Relative Price")
#PriceRelative vs SeatsTotal
plot(PriceRelative~SeatsTotal,data = British.df,ylim = c(0,2),ylab="Relative Price",xlim=c(100,400)
#PriceRelative vs Aircraft
plot(PriceRelative~Aircraft,data = British.df,ylim = c(0,1.5),ylab="Relative Price")
#DELTA AIRLINES
#Creating subset of Delta airlines
Delta.df <- subset(SixAirlines.df, Airline=="Delta")
#Summary statistics
summary(Delta.df)
#Formulating a regression model: y=b0+b1*x1+b2*x2+..
#where y= PriceRelative
#x1= WidthDifference, x2= PitchDifference, x3= FractionPremiumSeats, x4= FlightDuration
#x5= FlightDuration, x6= TravelMonth, x7= Aircraft, x8=IsInternational
#Fitting a Linear Regression Model using lm()
fit <-lm(PriceRelative~WidthDifference+PitchDifference+FractionPremiumSeats+FlightDuration+SeatsTotal+TravelMonth+Aircraft+IsInternational,data= Delta.df)
summary(fit)
#Significant Factor(s): Width Difference, Flight Duration and Travel Month.
#Scatter plot of significant factors vs Relative Price:
#PriceRelative vs WidthDifference
plot(PriceRelative~WidthDifference,data = Delta.df,ylim = c(0,0.6),ylab="Relative Price")
#PriceRelative vs FlightDuration
plot(PriceRelative~FlightDuration,data = Delta.df,ylim = c(0,0.6),ylab="Relative Price")
#PriceRelative vs TravelMonth
plot(PriceRelative~TravelMonth,data = Delta.df,ylim = c(0,0.6),ylab="Relative Price",xlim=c(0,10))
#JET AIRLINES
#Creating subset of Jet airlines
Jet.df <- subset(SixAirlines.df, Airline=="Jet")
#Summary statistics
summary(Jet.df)
#Formulating a regression model: y=b0+b1*x1+b2*x2+..
#where y= PriceRelative
#x1= WidthDifference, x2= PitchDifference, x3= FractionPremiumSeats, x4= FlightDuration
#x5= FlightDuration, x6= TravelMonth, x7= Aircraft
#Fitting a Linear Regression Model using lm()
fit <-lm(PriceRelative~WidthDifference+PitchDifference+FractionPremiumSeats+FlightDuration+SeatsTotal+TravelMonth+Aircraft,data= Jet.df)
summary(fit)
#Significant Factor(s): Width Difference, Fraction of Premium Seats, Flight Duration and Total Seats.
##Scatter plot of significant factors vs Relative Price:
#PriceRelative vs WidthDifference
plot(PriceRelative~WidthDifference,data = Jet.df,ylim = c(0,2),ylab="Relative Price")
#PriceRelative vs FractionPremiumSeats
plot(PriceRelative~FractionPremiumSeats,data = Jet.df,ylim = c(0,2),ylab="Relative Price")
#PriceRelative vs FlightDuration
plot(PriceRelative~FlightDuration,data = Jet.df,ylim = c(0,2),ylab="Relative Price",xlim=c(0,10))
#PriceRelative vs SeatsTotal
plot(PriceRelative~SeatsTotal,data = Jet.df,ylim = c(0,2),ylab="Relative Price",xlim=c(0,200))
#SINGAPORE AIRLINES
#Creating subset of Singapore airlines
Singapore.df <- subset(SixAirlines.df, Airline=="Singapore")
#Summary statistics
summary(Singapore.df)
#Formulating a regression model: y=b0+b1*x1+b2*x2+..
#where y= PriceRelative
#x1= WidthDifference, x2= PitchDifference, x3= FractionPremiumSeats, x4= FlightDuration
#x5= FlightDuration, x6= TravelMonth, x7= Aircraft
#Fitting a Linear Regression Model using lm()
fit <-lm(PriceRelative~WidthDifference+PitchDifference+FractionPremiumSeats+FlightDuration+SeatsTotal+TravelMonth+Aircraft,data= Singapore.df)
summary(fit)
#Significant Factor(s): Fraction of Premium Seats.
#Scatter plot of significant factors vs Relative Price:
#PriceRelative vs FractionPremiumSeats
plot(PriceRelative~FractionPremiumSeats,data = Singapore.df,ylim = c(0,1.5),ylab="Relative Price")
#VIRGIN AIRLINES
#Creating subset of Virgin airlines
Virgin.df <- subset(SixAirlines.df, Airline=="Virgin")
#Summary statistics
summary(Virgin.df)
#Formulating a regression model: y=b0+b1*x1+b2*x2+..
#where y= PriceRelative
#x1= WidthDifference, x2= PitchDifference, x3= FractionPremiumSeats, x4= FlightDuration
#x5= FlightDuration, x6= TravelMonth, x7= Aircraft
#Fitting a Linear Regression Model using lm()
fit <-lm(PriceRelative~WidthDifference+PitchDifference+FractionPremiumSeats+FlightDuration+SeatsTotal+TravelMonth+Aircraft,data= Virgin.df)
summary(fit)
#Significant Factor(s): Null
#Additional Analysis
#Box plot of Flight duration vs Airlines
boxplot(SixAirlines.df$FlightDuration~SixAirlines.df$Airline, ylim = c(0,15),xlab="Airlines", ylab="Flight Duration")
#Bar plot of Total no of flights v Airlines
plot(SixAirlines.df$Airline, ylim = c(0,200),xlab="Airlines", ylab="Total no. of flights")
#Bar plot of Number of aircrafts v Aircraft manufacturers
plot(SixAirlines.df$Aircraft, ylim = c(0,400),xlab="Aircraft Manufacturers", ylab="No of aircrafts")
#Bar plot of No of flights vs Type of flight
plot(SixAirlines.df$IsInternational, ylim = c(0,500),xlab="Type of flight", ylab="No of flights")
|
b60685af46e9aaaa07f10cd375cc5e8d347fdac1
|
3ea3b413e848585a25f23ee4d0c4cc7722ba6018
|
/R/GetAuthorGenders.R
|
af55a9d65619ff41f3c34d30678328b83150e9be
|
[] |
no_license
|
kmanlove/ParticipationInComputing
|
4df1d3222d183cd67a5015c05156eb007dbc1148
|
9ebdcf5b5067fbff8fbb75dff987787b5aab9e7f
|
refs/heads/master
| 2021-01-20T10:49:53.871050
| 2015-04-02T02:28:59
| 2015-04-02T02:28:59
| 32,650,960
| 0
| 1
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,795
|
r
|
GetAuthorGenders.R
|
GetAuthorGenders <- function(issn.in, sample.in)
{
journal.test <- cr_journals(issn = issn.in, works = T,
sample = sample.in,
filter = c(from_pub_date = '2005-01-01')
)
X <- sprintf("journals/%s/works", issns[1])
sample <- sample.in
myfilter <- c(from_pub_date = '2005-01-01')
filter <- rcrossref:::filter_handler(myfilter)
args <- rcrossref:::cr_compact(list(query = NULL, filter = filter, offset = NULL,
rows = NULL, sample = sample, sort = NULL,
order = NULL))
test.out <- rcrossref:::cr_GET(endpoint = X, args, todf = T)
# switch todf to T from default F to get all authors in list
author.out <- test.out$message$items$author
author.first <- vector("list", length(author.out))
for(i in 1:sample){
author.first[[i]] <- author.out[[i]]$given
}
author.first.all <- do.call("c", author.first)
author.first.noinits <- strsplit(x = author.first.all[10], split = "..[:punct:]")
author.first.noinits <- strsplit(x = author.first.all[10], split = "\\s")
author.first.noinits <- rep(NA, length(author.first.all))
for(i in 1:length(author.first.all)){
author.first.noinits[i] <- strsplit(x = author.first.all[i], split = "\\s")[[1]]
}
author.genders <- gender(as.character(author.first.noinits))
gender.out <- prop.female <- rep(NA, length(author.first.noinits))
for(i in 1:length(author.first.noinits)){
prop.female[i] <- author.genders[[i]]$proportion_female
gender.out[i] <- author.genders[[i]]$gender
print(i)
}
gender.nas <- table(is.na(gender.out) == T)["TRUE"]
return(list(gender.out = gender.out, prop.female = prop.female, gender.nas = gender.nas))
}
|
c5354ac8d209f97e0b36980cbaa83187f54a3d4f
|
2bba5609fad00dbfc4b93c84978b08d35954d977
|
/man/treemer.Rd
|
e65874f895e5172f84fb92e2f1948d04d72351fb
|
[
"MIT"
] |
permissive
|
kant/sitePath
|
416d8f59a453ccd4e76ad2fdab05b03cbd905f4b
|
73a76a56cb6df52468a1243057ee1e2ccfa2b3ad
|
refs/heads/master
| 2022-10-20T17:50:14.530724
| 2020-06-16T09:28:15
| 2020-06-16T12:48:45
| 272,836,800
| 0
| 0
|
MIT
| 2020-06-16T23:58:11
| 2020-06-16T23:58:10
| null |
UTF-8
|
R
| false
| true
| 1,826
|
rd
|
treemer.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/treemer.R
\name{treemer}
\alias{treemer}
\alias{similarityMatrix}
\alias{groupTips}
\title{Topology-dependent tree trimming}
\usage{
similarityMatrix(tree)
groupTips(
tree,
similarity = NULL,
simMatrix = NULL,
forbidTrivial = TRUE,
tipnames = TRUE
)
}
\arguments{
\item{tree}{The return from \code{\link{addMSA}} function}
\item{similarity}{Similarity threshold for tree trimming in \code{groupTips}.
If not provided, the mean similarity substract standard deviation of all
sequences will be used.}
\item{simMatrix}{A diagonal matrix of similarities for each pair of
sequences.}
\item{forbidTrivial}{Does not allow trivial trimming}
\item{tipnames}{If return as tipnames}
}
\value{
\code{similarityMatrix} returns a diagonal matrix of similarity
between sequences
\code{groupTips} returns grouping of tips
}
\description{
\code{similarityMatrix} calculates similarity between aligned
sequences The similarity matrix can be used in \code{\link{groupTips}} or
\code{\link{lineagePath}}
\code{groupTips} uses sequence similarity to group tree tips.
Members in a group are always constrained to share the same ancestral node.
Similarity between two tips is derived from their multiple sequence
alignment. The site will not be counted into total length if both are gap.
Similarity is calculated as number of matched divided by the corrected
total length. So far the detection of divergence is based on one simple
rule: the miminal pairwise similarity. The two branches are decided to be
divergent if the similarity is lower than the threshold.
}
\examples{
data('zikv_tree')
data('zikv_align')
tree <- addMSA(zikv_tree, alignment = zikv_align)
simMatrix <- similarityMatrix(tree)
groupTips(tree, 0.996, simMatrix)
}
|
b7678ef8aa96da71daf1435c11aaed1a29e9166b
|
4a2d5b3331bfcf892aecc61c52d35fb0ef4584d2
|
/attic/ImplementationParameter_Class.R
|
01e9b874f1558d7ebddb9f113a2fdc932de8d8ea
|
[
"BSD-3-Clause"
] |
permissive
|
openml/openml-r
|
ede296748ae1b9bcf22d661f4e25f495283402dd
|
530b00d9bde9895d5ba9224dbc812aeb3095e0f3
|
refs/heads/master
| 2022-11-09T02:51:47.329148
| 2022-10-19T19:50:09
| 2022-10-19T19:50:09
| 12,809,430
| 78
| 32
|
NOASSERTION
| 2019-11-19T16:00:48
| 2013-09-13T12:52:44
|
Jupyter Notebook
|
UTF-8
|
R
| false
| false
| 697
|
r
|
ImplementationParameter_Class.R
|
ImplementationParameter = function(name, data.type, default.value = NA_character_,
description = NA_character_) {
assertString(name)
assertString(data.type)
assertString(default.value, na.ok = TRUE)
assertString(description, na.ok = TRUE)
makeS3Obj("ImplementationParameter",
name = name,
data.type = data.type,
default.value = default.value,
description = description
)
}
#' @export
print.ImplementationParameter = function(x, ...) {
cat(x$name)
if (!is.na(x$data.type)) cat(' : ', x$data.type)
if (!is.na(x$default.value)) cat(' (default value = ', x$default.value, ' )')
if (!is.na(x$description)) cat('\n Description : ', x$description)
cat('\n')
}
|
b320f57f5e2a02b9093c59d5c1f57c74fdfdd9e9
|
3b6b2868f4745b60324d3d0aaf30a46cd0e25ec3
|
/best.R
|
e5b547d54870607878e43a67e56e88a2c192867d
|
[] |
no_license
|
benirvin/R-PROG_pa3
|
cc2ca287d7a0e891a26a90f2b4751711eda83b9f
|
9cc2d1fcc5682cf045a34f12311e89c9ad52938f
|
refs/heads/master
| 2021-04-03T06:26:37.937753
| 2018-03-10T04:29:18
| 2018-03-10T04:29:18
| 124,614,066
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 732
|
r
|
best.R
|
best <- function(state,outcome)
{
mind <- vector()
if (!state %in% state.abb)
stop("invalid state")
if (!outcome %in% c("heart attack", "heart failure", "pneumonia"))
stop("invalid outcome")
if (outcome=="heart attack") dfcol <-11
else if (outcome=="heart failure") dfcol <-17
else dfcol <-23
minrate <- min(outcomes[which(outcomes$State==state),dfcol],na.rm = TRUE)
j <- 0
for (i in outcomes[which(outcomes$State==state),dfcol]) {
j <- j + 1
if (is.na(i)) next
if (i==minrate) {
hosp <- outcomes[which(outcomes$State==state),2][j]
mind <- append(mind,hosp)
}
}
print(length(mind))
min(mind)
}
|
816b46329d864257a6dc527cf6b4b2be475a75bb
|
1f6bad66bc5c9a4b41248ad53ab60655611a2a4f
|
/functions.R
|
8f468cece3abb4fbc9e0550c4fba9dd87264fe87
|
[] |
no_license
|
felixdietrich/git
|
1ea1485730fe110222d21aef814be4d669c09928
|
d14438bd9cc559ae1d19730f3ad967211464d2fd
|
refs/heads/master
| 2018-09-16T01:26:59.784770
| 2018-06-15T21:28:32
| 2018-06-15T21:28:32
| 105,157,326
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 28,464
|
r
|
functions.R
|
# https://stackoverflow.com/questions/26118622/r-user-defined-functions-in-new-environment
.hE <- new.env()
# attach(.hE,name="helper",pos=-1)
# detach(.hE,name="helper")
# source('~/Dropbox/newdiss/git/functions.R')
# source('~/Dropbox/newdiss/git/functions_plot.R')
# print(c('Data','Holidays','Outliers','DOWN-IB','OutliersOLD'))
# loadFunctions <- function(x)
# {
### Data ----
# if(sum(x %in% 'Data')>=1) {
.hE$Mode <- function(x) {
ux <- unique(x)
ux[which.max(tabulate(match(x, ux)))]
}
.hE$wherestart <- function(x, mode='full') { # full: uses the first value incl. NA's / na: the first complete
if(ncol(x)==1) {
print(first(x[!is.na(x)])); print(last(x[!is.na(x)]))
return(paste0(index(first(x[!is.na(x)])),'/',index(last(x[!is.na(x)]))))
}
if(ncol(x)!=1) {
if(mode=='full') { print(first(x[rowSums(x, na.rm=T)!=0])); print(last(x[rowSums(x, na.rm=T)!=0]))
return(paste0(index(first(x[rowSums(x, na.rm=T)!=0])),'/',index(last(x[rowSums(x, na.rm=T)!=0])))) }
if(mode=='na') { print(first(x[rowSums(x)!=0])); print(last(x[rowSums(x)!=0]))
return(paste0(index(first(x[rowSums(x)!=0])),'/',index(last(x[rowSums(x)!=0])))) }
}
}
.hE$duplicatedindex <- function(x,y='show') {
if(y=='show') print(x[ duplicated( index(x) ), ])
if(y=='remove') x[ ! duplicated( index(x) ), ]
}
.hE$findmissingvalues <- function(z,j) {
subset(apply.daily(z, nrow), apply.daily(z, nrow)!=j)
}
.hE$findgaps <- function(x,y='intraday') {
if(y=='intraday') {
gapsat=index(x[ which( diff(index(x))>1 ) +2 ]) # nochmal checken, old code
# gapdates=as.Date(gapsat, tz=indexTZ(x))
gapdates=as.Date(gapsat)
print(gapdates)
where=gapdates[which(diff(gapdates)<1)] # wo gibt es gaps die nicht weekend sind
return(where) }
if(y=='weekendcurrencies') {
temp=as.list(which( diff(index(mid))>16 ))
# temp=as.character(as.Date(index(x[ which( diff(index(x))>16 ) ])))
# print(lapply(temp, function(y) tail(x[y])))
print(lapply(temp, function(y) x[(y-3):(y+3)]))
return(index(x[ which( diff(index(x))>16 ) ])) }
if(y=='highfreq') { return(index(x[ which( diff(index(x))>1 ) ])) }
# weekly:
# dates_have=dates_have[4:length(dates_have)] # remove the first non-consistent
# dates_have
# dates_want=dates_have[1]+seq(from=0,to=length(dates_have),by=1)*7
# lapply(g, na.omit)
# then rbind
# then duplicates remove
}
.hE$containsamevalues <- function(x,y=NULL,exceptNA=NULL,printNA=NULL,return=NULL) {
dat <- x
if(!is.null(y)) {
print(paste('Duplicates x:',anyDuplicated(index(x))))
print(paste('Duplicates y:',anyDuplicated(index(y))))
if(!is.null(printNA)) { print(which.na.xts(x)); print(which.na.xts(y)) }
# print(x[duplicated( index(x) )])
# print(y[duplicated( index(y) )])
dat <- rbind(x,y)
}
if(!is.null(exceptNA)) dat <- na.omit(dat)
f1 <- duplicated( index(dat) ) # this is Y
f2 <- duplicated( index(dat), fromLast = 'TRUE' ) # this is X
test1 <- dat[f1]; test2 <- dat[f2]; print(paste0(nrow(test1),'/',nrow(test2),' duplicates equal ',all.equal(test1,test2)))
if(return=='binded') return(rbind(test2,test1))
if(return=='listed') return(list(test2,test1))
# mergedat <- dat[ ! duplicated( index(dat) ), ]
}
.hE$dataone <- function(x=NULL,whereall=NULL,where=NULL,files=NULL,saveas=NULL) # dat muss list sein
{
dat <- x
if(!is.null(where)) dat <- lapply(paste0(where,files,'.rds'), readRDS)
if(!is.null(whereall)) dat <- lapply(list.files(whereall), readRDS)
# print(head(dat))
print(do.call(rbind, lapply(dat, colnames)))
# dat <- lapply(dat, na.omit)
dat <- do.call(rbind, dat[ unlist(lapply(dat, function(x) nrow(x)!=0))] ) # rbind but remove those completely without values (to keep colnames)
# wird jetzt aktuelle oder alte data removed?
if(max(table(index(dat)))==1) { print('no duplicates'); return(dat) } # ACHTUNG HIER FUNKTIONIERT DANN SAVEAS NICHT
if(max(table(index(dat)))>=2) {
print(max(table(index(dat))))
f1 = duplicated( index(dat) )
f2 = duplicated( index(dat), fromLast = 'TRUE' )
test1=dat[f1]; test2=dat[f2]; print(paste('duplicates equal',all.equal(test1,test2)))
# find all duplicated data
# man muesste die duplicates anhand rowSums identifizieren
# print(nrow(dat))
allduplicates <- dat[ index(dat) %in% index(dat[duplicated( index(dat) )]) ]
# print(nrow(allduplicates))
woduplicates <- dat[ ! index(dat) %in% index(dat[duplicated( index(dat) )]) ]
# print(nrow(woduplicates))
duplicates_wona <- na.omit(allduplicates) # remove first the NA's (maybe the duplicate has correct values)
duplicates_wona <- duplicates_wona[ ! duplicated( index(duplicates_wona) ), ] # then remove duplicates
if(all.equal(unique(index(allduplicates)),unique(index(duplicates_wona)), check.attributes=FALSE)==FALSE) print('some observations completely removed')
# mergedat <- dat[ ! duplicated( index(dat) ), ]
mergedat <- rbind(woduplicates, duplicates_wona) }
if(!is.null(saveas)) { saveRDS(mergedat, saveas); return() }
return(mergedat)
}
# dataone('~/',c('MMPamin.rds','MMPbmin.rds','MMPcmin.rds','MMPdmin.rds'),'MMPaminnew.rds')
# twowayplot = function(x,y)
# {
# tempdata=cbind(x,y)
# name1=gsub('.Open','',colnames(x)[1]); name2=gsub('.Open','',colnames(y)[1])
# plot(as.zoo(tempdata[,1]), las=1, xlab="", ylab='', main=paste(name1,'vs.',name2)) #mtext('AUD/JPY')
# par(new=TRUE)
# plot(as.zoo(tempdata[,2]), col=3, bty='n', xaxt="n", yaxt="n", xlab="", ylab="")
# axis(side = 4)
# legend('topleft', c(name1,name2), lty=c('solid','solid'), lwd=2, col=c('black','green'), cex=0.8) # inset=c(-0.4,0)
# }
.hE$normalize <- function(x,y=1) {
if(ncol(x)==1) return(x*as.numeric(100/x[1])) # first(x)
if(ncol(x)>1) {
temp <- apply(x, 2, function(x) x/as.numeric(first(x))*y)
ifelse(class(x)[1]=='xts',return(xts(temp, index(x))),return(temp)) }
}
.hE$indexmin <- function(x,y,z) { x[.indexhour(x) %in% y & .indexmin(x) %in% z] } # gibt dasselbe
.hE$which.max.xts <- function(data) {
ncol=seq(1:ncol(data))
# lapply(ncol, function(x) data[which.max(data[,x]),x])
lapply(ncol, function(x) data[data[,x] %in% sort(coredata(data[,x]), decreasing=TRUE)[1:5]])
}
.hE$which.min.xts <- function(data) {
ncol=seq(1:ncol(data))
# lapply(ncol, function(x) data[which.min(data[,x]),x])
lapply(ncol, function(x) data[data[,x] %in% sort(coredata(data[,x]))[1:5]])
}
.hE$which.na.xts <- function(data, full=NULL) {
# ncol=seq(1:ncol(data))
# lapply(ncol, function(x) data[which.min(data[,x]),x])
if(!is.null(full)) return(data[rowSums(data, na.rm=T)==0])
data[is.na(rowSums(data))]
}
.hE$which.na.xts2 <- function(data) {
do.call(rbind, lapply(c(1:ncol(data)), function(x) data[is.na(data[,x])]))
}
.hE$snap <- function(yyy) # mit getClose function zusammenlegen! wo hatte ich das benutzt?
{
tempX=yyy['T16:59/T17:00:01'] # at 16:59
tempY=cbind(xts(tempX[,4], order.by=as.Date(index(tempX), 'EST5EDT')),
xts(tempX[,8], order.by=as.Date(index(tempX), 'EST5EDT')))
tempZ=tempY[,2]-tempY[,1]
return(tempZ)
}
.hE$snap2 <- function(yyy)
{
tempX=yyy['T16:59/T17:00:01'] # at 16:59
tempY=cbind(xts(tempX[,4], order.by=as.Date(index(tempX), 'EST5EDT')),
xts(tempX[,8], order.by=as.Date(index(tempX), 'EST5EDT')))
tempZ=(tempY[,2]-tempY[,1])/((tempY[,2]+tempY[,1])/2)
return(tempZ)
}
.hE$getOHLC <- function(z,close='Real') { # ,what=NULL
data <- z
indexTZ(data) <- 'EST5EDT'
data <- (data[,c(1:4)]+data[,c(5:8)])/2
if(close=='Real') data <- z['T09:30/T16:00']
if(close=='1MinBefore') data <- z['T09:31/T15:59']
# if(close=='Full') # nothing
tz <- indexTZ(data)
teSSt <<- data
data <- to.daily(data, drop.time = FALSE) ### drop.time = FALSE
index(data) <- as.Date(index(data), tz=tz)
return(data)
}
.hE$getClose <- function(z,what=NULL,plot=NULL) {
indexTZ(z) <- 'EST5EDT'
lala <- gsub(".Open", "", colnames(z)[1])
z$Mid <- (z[,8]+z[,4])/2
close1 <- z$Mid['T16:00/T16:00:01']
close2 <- z$Mid['T15:59/T15:59:01']
index(close1) <- as.Date(index(close1), tz='EST5EDT') # nicht notwendig, aber...
index(close2) <- as.Date(index(close2))
from <- index(first(close1))
to <- index(last(close1))
close <- cbind(close1,close2)
colnames(close) <- c('RealClose','1MinBefore')
if(!is.null(plot)) {
require(quantmod)
xx <- getSymbols(plot, auto.assign=F, from=from, to=to, src='google')
close <- cbind(close1,close2,xx[,4])
colnames(close) <- c('RealClose','1MinBefore','Quantmod') }
# print(head(close))
if(!is.null(plot)) {
if(what=='RealClose') plot(close[,'RealClose'], main=plot)
if(what=='1MinBefore') plot(close[,'1MinBefore'], main=plot)
try(lines(xx[,6], col='red'), silent=TRUE)
try(lines(xx[,4], col='green'), silent=TRUE)
}
if(!is.null(what)) return(close)
colnames(close1) <- lala
return(close1)
}
.hE$getSundays <- function(year) {
dates <- seq(as.Date(paste0(year,"-01-01")),as.Date(paste0(year,"-12-31")), by = "day")
dates[weekdays(dates) == "Sunday"]
}
.hE$removeSundays <- function(z) {
z <- z[!weekdays(as.Date(index(z), tz=indexTZ(z))) %in% 'Sunday']
return(z)
}
.hE$smoothxts <- function(x) { xts(smooth.spline(as.timeSeries(x))$y, order.by = index(x)) }
.hE$plothourly <- function(z,sunday='yes',outliers=NULL,save='no') # braucht als z bid-ask argument
{
Sys.setenv(TZ=indexTZ(z))
print(Sys.timezone())
asd <- seq(0:23)
if(sunday=='no') z <- z[!weekdays(as.Date(index(z), tz='EST5EDT')) %in% 'Sunday']
if(!is.null(outliers)) z <- z[!z %in% sort(as.numeric(z), decreasing=T)[1:outliers]]
test <- lapply(asd, function(x) z[.indexhour(z) %in% x])
tobox <- do.call(cbind, lapply(test, function(x) as.numeric(x)))
boxplot(tobox, col='magenta', border='lightgrey', main=substr(colnames(z),1,6)) # names=names,
if(save=='yes') {
pdf(paste(substr(colnames(z),1,6),'plot_hourly.pdf',sep=''), width=14, height = 7)
boxplot(tobox, col='magenta', border='lightgrey', main=substr(colnames(z),1,6)) # names=names,
mtext(paste(as.Date(index(first(z)), tz='EST5EDT'),'-',as.Date(index(last(z)), tz='EST5EDT')))
dev.off() }
}
.hE$checkcorrecttime <- function(z,critical=NULL,year='2016',sunday='yes',save='no',outliers=NULL) # braucht als z bid-ask argument
# .GlobalEnv$checkcorrecttime <- function(z,critical=NULL,year='2016',sunday='yes',save='no',outliers=NULL) # braucht als z bid-ask argument
{
# plotdata = function(x) { plot(x, main=index(first(x))); Sys.sleep(5) }
### OLD WAY OF SUBSETTING
# subset <- paste('T',format(as.POSIXct('2000-01-01 8:00', tz='')+60*seq(5,565,by=5), '%H:%M'),'/T',
# format(as.POSIXct('2000-01-01 8:00', tz='')+60*seq(5,565,by=5)+10, '%H:%M:%S'),sep='')
subset <- paste('T',format(as.POSIXct('2000-01-01 0:00', tz='')+60*seq(5,1435,by=5), '%H:%M'),'/T',
format(as.POSIXct('2000-01-01 0:00', tz='')+60*seq(5,1435,by=5)+10, '%H:%M:%S'),sep='')
subset <- subset[!subset %in% c("T17:00/T17:00:10","T17:05/T17:05:10","T17:10/T17:10:10","T17:15/T17:15:10")]
# make hourly indicator from 08:05 to 17:25
### NEW WAY
Sys.setenv(TZ=indexTZ(z))
print(Sys.timezone())
# asd <- apply(cbind(rep(0:23, each=12),seq(0,55,by=5)), 1, as.list) # sonst wird 0:00 wird purem datum
asd <- apply(cbind(rep(0:23, each=12),seq(1,56,by=5)), 1, as.list)
names <- apply(cbind(rep(0:23, each=12),seq(1,56,by=5)), 1, function(x) paste(x[1],':',sprintf("%02d", x[2]),sep=''))
# plot TZ critical dates
if(!is.null(critical)) {
if(year=='2016') datex <- readRDS('~/Dropbox/data/critical_timezones_dates2016.rds')
if(year=='2014') datex <- readRDS('~/Dropbox/data/critical_timezones_dates2014.rds')
data <- z[as.character(datex)]; data2 <- split(data, 'days')
if(ncol(z)==1) lapply(data2, function(x) plot.zoo(x, main=index(first(x))))
if(ncol(z)==2) lapply(data2, function(x) { plot.zoo(x[,1], main=index(first(x))); lines(as.zoo(x[,2]), col='red') })
}
# doublecheck z[1725,] as.Date(index(z), tz='EST5EDT')[1725] # das braucht man OBWOHL Sys.timezone korrekt ist
if(sunday=='no') z <- z[!weekdays(as.Date(index(z), tz='EST5EDT')) %in% 'Sunday']
if(!is.null(outliers)) z <- z[!z %in% sort(as.numeric(z), decreasing=T)[1:outliers]]
if(is.null(critical)) {
# test <- lapply(subset, function(x) z[x])
test <- lapply(asd, function(x) z[.indexhour(z) %in% x[[1]] & .indexmin(z) %in% x[[2]]])
names(test) <- names
print(test['17:01']); print(test['17:06']); print(test['17:11'])
test['17:01'] <- 0; test['17:06'] <- 0; test['17:11'] <- 0
tobox <- do.call(cbind, lapply(test, function(x) as.numeric(x)))
# names <- unlist(lapply(test, function(x) unique(format(index(x), '%H:%M')))) # OLD
boxplot(tobox, col='magenta', border='lightgrey', names=names, main=substr(colnames(z),1,6))
if(save=='yes') {
pdf(paste(substr(colnames(z),1,6),'plotx.pdf',sep=''), width=14, height = 7)
boxplot(tobox, col='magenta', border='lightgrey', names=names, main=substr(colnames(z),1,6))
mtext(paste(as.Date(index(first(z)), tz='EST5EDT'),'-',as.Date(index(last(z)), tz='EST5EDT')))
dev.off()
}
# return(tobox)
}
}
#}
### Holidays ----
# if(sum(x %in% 'Holidays')>=1) {
.hE$holremove <- function(x,daysafter='yes') # updated!
{
require(timeDate) # as.Date(index(head(AUDJPY['2006-03-13'])), tz='') as.Date(index(head(AUDJPY['2006-03-13'])), tz='EST5EDT') das problem tritt aber nicht auf wenn US hours 930-1600 sind
x=x[!as.Date(index(x),tz='EST5EDT') %in% c(as.Date(holiday(2005:2015, Holiday = listHolidays('US'))),
as.Date(holiday(2005:2015, "ChristmasEve")),as.Date(DENewYearsEve(2005:2015)))]
### wie bei HF dataset
if(daysafter=='yes') {
unwanted=c(as.Date("2005-01-02"),as.Date("2006-01-02"),as.Date("2007-01-02"),as.Date("2008-01-02"),as.Date("2009-01-02"),as.Date("2010-01-02"),as.Date("2011-01-02"),as.Date("2012-01-02"),as.Date("2013-01-02"),as.Date("2014-01-02"),as.Date("2015-01-02"),as.Date("2016-01-02"),
as.Date("2005-12-26"),as.Date("2006-12-26"),as.Date("2007-12-26"),as.Date("2008-12-26"),as.Date("2009-12-26"),as.Date("2010-12-26"),as.Date("2011-12-26"),as.Date("2012-12-26"),as.Date("2013-12-26"),as.Date("2014-12-26"),as.Date("2015-12-26"),as.Date("2016-12-26"))
x=x[!as.Date(index(x),tz='EST5EDT') %in% unwanted] }
return(x)
}
.hE$showholidays <- function(from=1990,to=2020)
{
require(timeDate)
dates1 = c(as.character(holiday(from:to, Holiday = listHolidays('US'))),
as.character(holiday(from:to, "ChristmasEve")),
as.character(DENewYearsEve(from:to)))
sort(dates1)
}
.hE$isholremoved <- function(x,from=1990,to=2020,daysafter='yes') # daysafter makes clear: which holidays: only holidays or also 2.1. and 26.12.
{
require(timeDate)
dates1 = c(as.character(holiday(from:to, Holiday = listHolidays('US'))),
as.character(holiday(from:to, "ChristmasEve")),
as.character(DENewYearsEve(from:to)))
output=c(); for (i in from:to){ output[i]=as.character(paste(i,'-01-02',sep='')) }; dates2=na.omit(output)
output=c(); for (i in from:to){ output[i]=as.character(paste(i,'-12-26',sep='')) }; dates3=na.omit(output)
unwanted = as.Date(c(dates1,dates2,dates3))
if(daysafter=='no') unwanted = as.Date(c(dates1))
if(daysafter=='check') unwanted = as.Date(c(dates2,dates3))
if(daysafter=='yes') unwanted = as.Date(c(dates1,dates2,dates3))
x[as.Date(index(x),tz='EST5EDT') %in% unwanted]
}
# }
### Outliers ----
# if(sum(x %in% 'Outliers')>=1) {
.hE$checkoutliers_ba <- function(z,j=0.999,print='FALSE') # z=variables, j=which quantile, print or not
{
print(quantile(z[,8]-z[,4], probs=c(0.95,0.96,0.97,0.98,0.99,0.995,0.999,0.9995,0.9999), na.rm=T)) #na.rm new
uni=unique(z[,8]-z[,4][which(z[,8]-z[,4]>quantile(z[,8]-z[,4], probs=c(j), na.rm=T))])
print(sort(uni, decreasing = T))
if(print=='TRUE') print(z[(z[,8]-z[,4]) %in% c(uni[4:length(uni)])])
return(unique(format(index(z[which(z[,8]-z[,4]>quantile(z[,8]-z[,4], probs=c(j), na.rm=T))]), '%Y-%m-%d'))) # invisible(uni)
}
.hE$removeoutliers_ba_quantile <- function(z,j,print='FALSE') # new variable inserted 2017 / changed aug 2017
{
q=quantile(z[,8]-z[,4], probs = j, na.rm=T)
print(sort(unique(z[,8]-z[,4][which(z[,8]-z[,4]>q)]), decreasing = T)); print(q)
if(print=='TRUE') print(z[which(z[,8]-z[,4]>q)])
if(print=='TRUE') print(z[which(z[,8]-z[,4]<0)])
z=z[-which(z[,8]-z[,4]>=q)]
z=z[-which(z[,8]-z[,4]<=0)]
return(z)
}
.hE$printoutliers <- function(z,j,k=0) # wofuer ist k?
{
if(ncol(z)!=1) { q=quantile(z[,8]-z[,4], probs = j, na.rm=T)
print(sort(unique(z[,8]-z[,4][which(z[,8]-z[,4]>q)]), decreasing = T)); print(q)
if(k==1) print(z[which(z[,8]-z[,4]>q)])
if(k==1) print(z[which(z[,8]-z[,4]<0)])
z=z[-which(z[,8]-z[,4]>q)]
z=z[-which(z[,8]-z[,4]<0)]
return(z) }
if(ncol(z)==1) { print(quantile(na.omit(z), probs=c(0.95,0.96,0.97,0.98,0.99,0.995,0.999,0.9995,0.9999,0.99999)))
print(quantile(na.omit(z), probs=(1-c(0.95,0.96,0.97,0.98,0.99,0.995,0.999,0.9995,0.9999,0.99999)))) }
}
.hE$makewithoutoutliers <- function(z,j) # new variable inserted 2017
{
x = readRDS(paste('~/Dropbox/data/',z,'amin.rds',sep = '')) # assign?
x <- x[!duplicated(index(x)),]
x = x['1980/']
indexTZ(x) = 'EST5EDT'
x = x['T09:30/T16:00']
remove = c(0,which(is.na(x[,4])),which(is.na(x[,8])),which(x[,8]-x[,4] < 0),
which(x[,8]-x[,4] >= quantile(x[,8]-x[,4], probs = j, na.rm = T))) # wozu c0 nochmal?
# rbind index muesste auch gehen
# outliers1=DBVmin[,4][which(DBVmin[,4]>1)]; nrow(outliers1) ### somit kriegt man day after thanksgiving (friday)
# outliers2=DBVmin[,4][which(DBVmin[,4]<0)] ### !
# outliers=rbind(outliers1,outliers2) #outliers
# DBVmin=DBVmin[-DBVmin[index(outliers), which.i=TRUE]]
y = x[remove]
x = x[-remove]
print(length(remove)) # print how many
saveRDS(y, paste('~/Dropbox/',z,'mindeleted.rds',sep = ''))
assign(z, x, envir = .GlobalEnv)
saveRDS(x, paste('~/Dropbox/',z,'minclean.rds',sep = ''))
}
.hE$outliers2017 <- function(x,probs,return='outliers') {
outl <- na.omit(abs(diff(x)))
na <- cbind(x,NA)[,2] # series with NA's and same dates
quant <- quantile(outl, probs=probs)
outliers <- outl[which(outl>quant)]
data <- x[index(x) %in% index(outliers)]
removed <- x[!index(x) %in% index(outliers)]
na2 <- na[!index(na) %in% index(removed)] # print(na2)
cleaned <- na.locf(rbind(x[!index(x) %in% index(outliers)],na2))
if(return=='outliers') return(outliers)
if(return=='data') return(data)
if(return=='cleaned') return(cleaned)
if(return=='removed') return(removed)
}
.hE$mod_hampel <- function (x, k, t0 = 3, nu=0.0005) {
n <- dim(x)[1]
y <- x
ind <- c() #vector with the corrected (by filter) elements
L <- 1.4826
if(mean(x,na.rm = TRUE)>50) {nu <- 0.05} #for JPY use nu=0.05
for (j in 1: dim(x)[2]) { #loop through currencies
for (i in (k + 1):(n - k)) { #loop through time
x0 <- median(x[(i - k):(i + k),j],na.rm = TRUE)
S0 <- L * median(abs(x[(i - k):(i + k),j] - x0),na.rm = TRUE)
if (!is.na(x[i,j])) {
if (abs(x[i,j] - x0) > (t0 * S0 + nu) ) { #+nu makes it less responsive
y[i,j] <- x0
ind <- c(ind, i)
}
}
}
}
list(y = y, ind = ind)
}
#}
### DOWN-IB ----
#if(sum(x %in% 'IB')>=1) {
.hE$getCombine <- function(x, src='google', type='adjusted') {
# getCombine <<- function(x, src='google', type='adjusted') {
i <- 1
n <- length(x)
dat <- lapply(x, function(z)
tryCatch(getSymbols(z, src = src, auto.assign = FALSE),
error = function(e) {
print(paste0(i,'/',n," Could not download data for ", z))
i <<- i+1
return(NULL) },
finally = {
print(paste0(i,'/',n,' ',z))
i <<- i+1 }) )
dat <- dat[which(lapply(dat, function(x) class(x)[1])=='xts')]
# dat <- dat[-which(lapply(dat, is.null)==TRUE)] # DOES NOT WORK IF NONE IS TRUE
names(dat) <- gsub("\\..*", "", lapply(dat, function(x) colnames(x)[1]))
if(type=='raw') return(dat)
selectcolumn = function(x,c) {
# name <- deparse(substitute(x)) # funktioniert nicht in function
colnames(x) <- gsub("\\..*", "", colnames(x))
tryCatch({ x[,c] }, error = function(e) {
print(paste0('Column does not exist for ', colnames(x)[1])); return(NULL) } )}
combine <- function(x) { switch(type, first = selectcolumn(x,1), close = selectcolumn(x,4), adjusted = selectcolumn(x,6)) }
return(do.call(cbind, lapply(dat, combine)))
}
.hE$checkcorrecttimeX <- function(z,y='n') # hier fuer BA
{
# testx=as.numeric(apply.daily(HYG2, function(x) index(first(x))))
# as.POSIXct(testx, origin = "1970-01-01", tz='EST5EDT')
# ss=HYG['2008']
# ss1=ss['T09:55/T09:55:30']
# ss2=ss['T09:05/T09:05:30']
# boxplot(as.numeric(ss1$ba), horizontal = TRUE, border='green', col='green', main='09:05 vs. 09:55')
# boxplot(as.numeric(ss2$ba), horizontal = TRUE, add = TRUE, border='red', col='red')
subset <- paste('T',format(as.POSIXct('2000-01-01 8:00', tz='')+60*seq(5,565,by=5), '%H:%M'),'/T',
format(as.POSIXct('2000-01-01 8:00', tz='')+60*seq(5,565,by=5)+10, '%H:%M:%S'),sep='')
print(subset)
z$BA=z[,8]-z[,4]
# one=z$BA['T09:50/T09:50:30']; two=z$BA['T10:50/T10:50:30']
# barplot(mean(one, na.rm=T),mean(two, na.rm=T), xlab='', ylab='')
# print(median(one, na.rm=T)) print(median(two, na.rm=T)) # besser vllt fuer jede stunde und dann barplot?
if(y=='noplot') { }
}
.hE$makecorrecttime2 <- function(z)
{
tryCatch(makecorrecttime(z), error=function(e) print('ERROR'))
}
.hE$makecorrecttime <- function(z,data=NULL,plot=NULL,save=NULL) # ACHTUNG ASSIGNED AUCH
{
require(quantmod)
if(is.null(data)) x = readRDS(paste('~/Dropbox/data/universe/',z,'amin.rds',sep = '')) # assign?
if(!is.null(data)) x <- data
x <- x[!duplicated(index(x)),]
x = x['1980/']
indexTZ(x) = 'EST5EDT'
x = x['T09:30/T16:00']
colnames(x) = c(paste(z,'.bid.Open',sep = ''),paste(z,'.bid.High',sep = ''),
paste(z,'.bid.Low',sep = ''),paste(z,'.bid.Close',sep = ''),
paste(z,'.ask.Open',sep = ''),paste(z,'.ask.High',sep = ''),
paste(z,'.ask.Low',sep = ''),paste(z,'.ask.Close',sep = ''))
assign(z, x, envir = .GlobalEnv)
if(!is.null(save)) saveRDS(x, paste('~/data/',z,'mincorrecttime.rds',sep = ''))
if(!is.null(plot)) {
if(plot=='save') pdf(file = paste('~/Dropbox/',z,'.pdf',sep = ''), width = 5, height = 5, bg='white')
xx=getSymbols(z, auto.assign=F, from='2004-01-01', src='google')
#lim1=as.numeric(min(xx[,4],xx[,6],apply.daily(x[,4], median, na.rm=T)))
#lim2=as.numeric(max(xx[,4],xx[,6],apply.daily(x[,4], median, na.rm=T)))
#plot(apply.daily(x[,4], median, na.rm=T), ylim=c(lim1,lim2), main=z)
xxx <- apply.daily(x[,4], median, na.rm=T)
index(xxx) <- as.Date(index(xxx), tz='EST5EDT')
# toplot <<- as.zoo(xxx)
toplot <<- as.zoo(na.omit(cbind(xxx,xx[,4])))
try(toplot <<- as.zoo(na.omit(cbind(xxx,xx[,4],xx[,6]))))
plot.zoo(toplot[,1], xlab='', ylab='', main=z)
try(lines(toplot[,3], col='red'), silent=TRUE)
try(lines(toplot[,2], col='green'), silent=TRUE)
# try(lines(xx[,6], col='red'), silent=TRUE)
# try(lines(xx[,4], col='green'), silent=TRUE)
if(plot=='save') { print(paste(z,'plot saved')); dev.off() }
}
}
.hE$makeustime <- function(z,data=NULL)
{
if(is.null(data)) x = readRDS(paste('~/Dropbox/data/',z,'amin.rds',sep = ''))
if(!is.null(data)) x = data
x <- x[!duplicated(index(x)),]
x = x['1980/']
indexTZ(x) = 'EST5EDT'
colnames(x) = c(paste(z,'.bid.Open',sep = ''),paste(z,'.bid.High',sep = ''),
paste(z,'.bid.Low',sep = ''),paste(z,'.bid.Close',sep = ''),
paste(z,'.ask.Open',sep = ''),paste(z,'.ask.High',sep = ''),
paste(z,'.ask.Low',sep = ''),paste(z,'.ask.Close',sep = ''))
assign(z, x, envir = .GlobalEnv)
saveRDS(x, paste('~/data/',z,'minustime.rds',sep = ''))
}
.hE$readin <- function(z)
{
x = readRDS(paste(a,z,b,sep = '')) # assign?
assign(z, x, envir = .GlobalEnv)
}
attach(.hE,name="helper",pos=-1)
# a='~/Dropbox/data/intlETF/minute/'
# b='mincorrecttime.rds'
# daten=c('EWA','EWC','EWD','EWG','EWH','EWI','EWJ','EWK','EWL','EWM','EWN','EWO','EWP','EWQ','EWS','EWT','EWU','EWW','EWY','EWZ','EZU','SPY')
# sapply(daten, readin)
# }
# ### OutliersOLD ----
# if(sum(x %in% 'OutliersOLD')>=1) {
# removeoutliers <<- function(x) # nrow circa 369000 per year
# {
# xxx=0
# bidask=x[,8]-x[,4]
# for (i in ((nrow(x)-369000):1))
# {
# if (is.na(bidask)) # (is.na(x[i,4]) || is.na(x[i,8])) ### FEHLER??? hier muss noch ,i
# { print('na') }
# else { if (as.numeric(bidask[i,]) >= quantile(bidask[i:(i+369000),], probs = 0.99, na.rm = T))
# { print(i); xxx = rbind(xxx,i) } } }
# xxx2=which(bidask<0)
# xxx3=rbind(xxx,xxx2)
# x=x[-as.numeric(xxx3),]
# }
#
# ### DIESE FOR A RELATIVELY CLEAN SERIES LIKE VIXmin (oder pre-cleaned DBV?)
# # der VIX hat eine standard abweichung
# removeoutliers_ba <<- function(x) # nrow circa 369000 per year ## hier multiple columns durch ,
# {
# require(chemometrics) # wo ist der unterschied zwischen BA und RA?
# xxx = 0; xx1 = sd_trim(x, trim = 0.1); xx2 = sd(x)
# print(xx1,xx2)
# for (i in ((nrow(x)-50):1))
# { if (x[i,] >= (median(x[i:(i+50),])+5*xx1)) # bisher immer 5
# { print(x[i,]); xxx = rbind(xxx,i) } }
# x[xxx,] }
#
# removeoutliers_ra <<- function(x,y,z,setting) { # y = window, z = st.dev. away
# require(chemometrics); xxx = 0
# x_orig<-x
# if (setting == 'grob') { # hier koennte man auch noch ein split.xts wie bei vladi einbauen
# xx1 = sd_trim(x, trim = 0.1); xx2 = sd(x); print(xx1); print(xx2)
# med=median(x); med1=med + z * xx2; med2=med - z * xx2; print(c(med,med1,med2)) # changed to xx2 weil xx1 multiple columns returned
# # x[which(x>med1 | x<med2),]
# luk1=x[rowSums(x>med1)!=0,] # NICE WAY TO FIND OUTLIER IN ANY COLUMN
# luk2=x[rowSums(x<med2)!=0,] # NICE WAY TO FIND OUTLIER IN ANY COLUMN
# res=rbind(luk1,luk2); print(res); return(res)
# }
# else {
# # for (i in ((nrow(x) - y):1)) ### UNIVARIATE
# # {
# # xx1 = sd(x[i:(i + y)], na.rm=T); print(i); print(xx1) # wahlweise ROLLING STDEV
# # if (x[i] >= (median(x[i:(i + y)], na.rm=T) + z * xx1) | x[i] <= (median(x[i:(i + y)], na.rm=T) - z * xx1))
# # # falls ein value gefunden wurde, setze ihn dann auf 0, damit nicht verzerrt
# # { print(x[i]); x[i]<-NA # ; Sys.sleep(10); print(x[(i-5):(i+5)]) funktioniert
# # xxx = rbind(xxx,i) }
# # }
# x = xts(rowMeans(x), order.by = index(x))
# xx1 = sd_trim(x, trim = 0.1); xx2 = sd(x); print(xx1); print(xx2)
# for (i in ((nrow(x) - y):1))
# {
# # xx1 = sd(x[i:(i + y)], na.rm=T); print(i); print(xx1)
# if (x[i] >= (median(x[i:(i + y)], na.rm=T) + z * xx1) | x[i] <= (median(x[i:(i + y)], na.rm=T) - z * xx1))
# # falls ein value gefunden wurde, setze ihn dann auf 0, damit nicht verzerrt
# { print(x[i]); x[i]<-NA # ; Sys.sleep(10); print(x[(i-5):(i+5)]) funktioniert
# xxx = rbind(xxx,i) }
# }
# # x_orig[xxx]
# return(xxx)
# }
# }
#
# removeoutliers_mid <<- function(x) # nrow circa 369000 per year
# { xxx=0; xx=sd_trim(x, trim=0.1); print(xx)
# for (i in 6:nrow(x))
# #{ if (as.numeric(x[i,]) >= as.numeric(x[i-1,])+as.numeric(xx)/2) { print(x[i,]); xxx = rbind(xxx,i) } }
# { if (as.numeric(x[i,]) >= min(as.numeric(x[i:(i-5),]))+as.numeric(xx)) { print(x[i,]); xxx = rbind(xxx,i) } }
# x[xxx,]
# }
# # removeoutliersnew_c = function(x)
# # { xxx=0
# # for (i in ((nrow(x)-1000):1))
# # { if (x[i,] >= (median(x[i:(i+1000),])+5*sd_trim(x[i:(i+1000),], trim=0.1)))
# # { print(x[xxx,]); xxx = rbind(xxx,i) } }
# # x[xxx,] } ### ODER MAN MACHT wenn next value 10*vorher ist
#
# }
# }
|
b0810e7ff81b81623a31879a4f8e68edf3d1c33e
|
ffdea92d4315e4363dd4ae673a1a6adf82a761b5
|
/data/genthat_extracted_code/wnominate/examples/UN.Rd.R
|
54172711195a40197678555156f743517d2ea3a3
|
[] |
no_license
|
surayaaramli/typeRrh
|
d257ac8905c49123f4ccd4e377ee3dfc84d1636c
|
66e6996f31961bc8b9aafe1a6a6098327b66bf71
|
refs/heads/master
| 2023-05-05T04:05:31.617869
| 2019-04-25T22:10:06
| 2019-04-25T22:10:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 692
|
r
|
UN.Rd.R
|
library(wnominate)
### Name: UN
### Title: United Nations Vote Data
### Aliases: UN
### Keywords: datasets
### ** Examples
#The same data set can be obtained from downloading the UN.csv
#file from www.voteview.com and reading it as follows:
#UN<-read.csv("C:/UN.csv",header=FALSE,strip.white=TRUE)
data(UN)
UN<-as.matrix(UN)
UN[1:5,1:6]
UNnames<-UN[,1]
legData<-matrix(UN[,2],length(UN[,2]),1)
colnames(legData)<-"party"
UN<-UN[,-c(1,2)]
rc <- rollcall(UN, yea=c(1,2,3), nay=c(4,5,6),
missing=c(7,8,9),notInLegis=0, legis.names=UNnames,
legis.data=legData,
desc="UN Votes",
source="www.voteview.com")
# Not run
#result<-wnominate(rc,polarity=c(1,1))
#plot(result)
#summary(result)
|
51daf2bccd9cef39dde5d757fb52bb3111954533
|
b8c43e421f7216167380682c06ed9040db053627
|
/scripts/tfbs/prep.R
|
a83775f70c2d7257e70582b11c4aa37840361c5c
|
[] |
no_license
|
hmtzg/geneexp_mouse
|
5a896cb4722794c85f464a75d459caf84021ffa0
|
1f2434f90404a79c87d545eca8723d99b123ac1c
|
refs/heads/master
| 2022-02-22T13:31:09.135196
| 2022-02-02T09:02:15
| 2022-02-02T09:02:15
| 267,553,488
| 1
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 3,216
|
r
|
prep.R
|
library(tidyverse)
system('wget https://maayanlab.cloud/static/hdfs/harmonizome/data/transfacpwm/gene_attribute_matrix.txt.gz -P ./data/tfbs')
system('wget https://maayanlab.cloud/static/hdfs/harmonizome/data/transfacpwm/gene_attribute_edges.txt.gz -P ./data/tfbs')
system('wget https://maayanlab.cloud/static/hdfs/harmonizome/data/transfacpwm/gene_list_terms.txt.gz -P ./data/tfbs')
system('wget https://maayanlab.cloud/static/hdfs/harmonizome/data/transfacpwm/attribute_list_entries.txt.gz -P ./data/tfbs')
attr = read_tsv('./data/tfbs/gene_attribute_matrix.txt.gz')
attr = attr[,-2]
colnames(attr)[1] = 'GeneSym'
colnames(attr)[2] = 'GeneID'
tfgeneID = as.character(attr[2,])[-c(1,2)]
attr = attr[-c(1,2),]
attrlist = read_tsv('./data/tfbs/attribute_list_entries.txt.gz')
attrlist$X2 = NULL
attrlist
identical(as.character(attrlist$GeneID), tfgeneID) # same order
## hgnc gene id and tfbs target info:
edges = read_tsv('./data/tfbs/gene_attribute_edges.txt.gz')
summary(as.numeric(edges$source_desc))
edges$source_desc = NULL
summary(edges$target_id)
edges$target_desc=NULL
xx = t(as.data.frame(attr[attr$GeneSym%in%'ZNF767P',]))
xx[xx[,1]=="1.000000",]
edges[edges$source%in%'ZNF767P',]$target # same info
## Hgnc gene list and ids:
genelist = read_tsv('./data/tfbs/gene_list_terms.txt.gz')
genelist$X2 = NULL
genelist
sum(genelist$GeneSym%in%edges$source) # same list
## convert Hgnc ids to ENS:
martx = biomaRt::useMart(biomart = 'ensembl')
martHs_ = biomaRt::useDataset('hsapiens_gene_ensembl', mart=martx)
genemap = biomaRt::getBM(filters='hgnc_symbol', attributes = c('hgnc_symbol','ensembl_gene_id'),
values = genelist$GeneSym, mart = martHs_)
sum(duplicated(genemap$hgnc_symbol)) # 2594
sum(duplicated(genemap$ensembl_gene_id)) # 174
dup1 = unique(genemap$hgnc_symbol[duplicated(genemap$hgnc_symbol)]) # remove duplicates
genemap = genemap[!genemap$hgnc_symbol%in%dup1,]
sum(duplicated(genemap$ensembl_gene_id)) # 0 # remove duplicates if any
genelist = genelist[genelist$GeneSym%in%genemap$hgnc_symbol,] # remove genes not mapped to ENS id
edges[1,4] = 'target_geneid'
edges[1,3] = 'target_GeneSym'
colnames(edges) = edges[1,]
edges = edges[-1,]
table(edges$weight) # only target info
# subset matrix with genes having only ENS ids:
edges = edges %>%
filter(GeneSym%in%genelist$GeneSym)
colnames(genemap) = c('GeneSym', 'ENS')
edges = edges %>%
left_join(genemap)
martMm_ = biomaRt::useDataset('mmusculus_gene_ensembl', mart=martx)
ensmap = biomaRt::getLDS(attributes = c('ensembl_gene_id'), filters = 'ensembl_gene_id',
values = unique(edges$ENS), mart = martHs_,
attributesL = c('ensembl_gene_id'), martL = martMm_)
colnames(ensmap) = c('ENS_hs', 'ENS_mm')
dup1 = unique(ensmap$ENS_hs[duplicated(ensmap$ENS_hs)]) # 691 duplicate genes
ensmap = ensmap[!ensmap$ENS_hs%in%dup1,]
dup2 = unique(ensmap$ENS_mm[duplicated(ensmap$ENS_mm)]) # 123 duplicate genes
ensmap = ensmap[!ensmap$ENS_mm%in%dup2,]
# 14150 uniquely matching genes
edges = edges %>%
rename(ENS_hs = ENS) %>%
right_join(ensmap)
saveRDS(edges,
file = './data/tfbs/attr.rds')
save(list=ls(), file='./data/tfbs/prep.rdata')
|
91ef48150c541dddf3bab3d18d23e865b6f28b05
|
8d34a5846b55474e1db54cc3595ac725b1a96404
|
/man/filter.Rd
|
fa8683325a58cdfee33a06ccc43d15d58a7fe42a
|
[] |
permissive
|
federman/poorman
|
6f1f76ea1c262a430dbd80b840897d4f1b603b76
|
3cc0a9920b1eb559dd166f548561244189586b3a
|
refs/heads/master
| 2023-05-14T12:33:25.016104
| 2022-12-29T18:35:59
| 2022-12-29T18:35:59
| 243,791,745
| 0
| 0
|
MIT
| 2020-02-28T15:19:14
| 2020-02-28T15:19:13
| null |
UTF-8
|
R
| false
| true
| 1,216
|
rd
|
filter.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/filter.R
\name{filter}
\alias{filter}
\title{Return rows with matching conditions}
\usage{
filter(.data, ..., .preserve = FALSE)
}
\arguments{
\item{.data}{A \code{data.frame}.}
\item{...}{Logical predicated defined in terms of the variables in \code{.data}. Multiple conditions are combined with
\code{&}. Arguments within \code{...} are automatically quoted and evaluated within the context of the \code{data.frame}.}
\item{.preserve}{\code{logical(1)}. Relevant when the .data input is grouped. If \code{.preserve = FALSE} (the default), the
grouping structure is recalculated based on the resulting data, otherwise the grouping is kept as is.}
}
\value{
A \code{data.frame}.
}
\description{
Use \code{filter()} to choose rows/cases where conditions are \code{TRUE}.
}
\section{Useful filter functions}{
\itemize{
\item \code{==}, \code{>}, \code{>=}, etc.
\item \code{&}, \code{|}, \code{!}, \code{xor()}
\item \code{is.na()}
}
}
\examples{
filter(mtcars, am == 1)
mtcars \%>\% filter(cyl == 4)
mtcars \%>\% filter(cyl <= 5 & am > 0)
mtcars \%>\% filter(cyl == 4 | cyl == 8)
mtcars \%>\% filter(!(cyl \%in\% c(4, 6)), am != 0)
}
|
88b1a63083c30ada6148b749304ac152e3d11075
|
6ad28f2b9f1bac776c7af846e9f9988e7a0b5622
|
/codi/generacio_mostra.R
|
f4ef8808bda515993097714e5cdc759bda4afc46
|
[] |
no_license
|
jrealgatius/PRECAV
|
265e28b01849b9c09e6f5eae52a15f219c55e802
|
0e9a30f7adf072d9fe798ee0d01cfae947b2ce46
|
refs/heads/master
| 2022-10-25T07:16:36.696286
| 2022-10-06T08:47:29
| 2022-10-06T09:05:17
| 194,812,677
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 5,916
|
r
|
generacio_mostra.R
|
memory.size(max=160685)
#
##################### Directori Font ==============================
rm(list=ls())
###
library(dplyr)
directori.arrel[file.exists(directori.arrel)] %>%
file.path("Stat_codis/funcions_propies.R") %>%
source()
library(here)
### LECTURA ---------------------------
# CATALEG<-readRDS("ECV_CAT_entregable_cataleg_20190517_101801.rds")
# library("xlsx")
LLEGIR.PACIENTS<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_pacients_20190517_101801.rds")) %>% as_tibble() %>% head(n)}
LLEGIR.PROBLEMES<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_problemes_20181123_172533.rds"))%>% as_tibble() %>% head(n)}
LLEGIR.CMBDH<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_cmbd_dx_20181123_172533.rds"))%>% as_tibble() %>% head(n)}
LLEGIR.padris<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_cmbd_dx_padris_20181123_172533.rds"))%>% as_tibble() %>% head(n)}
LLEGIR.PROC<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_cmbd_px_padris_20181123_172533.rds"))%>% as_tibble() %>% head(n)}
LLEGIR.TABAC<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_tabaquisme_20181123_172533.rds"))%>% as_tibble() %>% head(n) }
LLEGIR.DERIVACIONS<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_derivacions_20181123_172533.rds"))%>% as_tibble() %>% head(n) }
LLEGIR.FX.FACTURATS<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_facturacions_20190705_071704.rds"))%>% as_tibble() %>% head(n) }
LLEGIR.FX.PRESCRITS<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_prescripcions_20190705_071704.rds"))%>% as_tibble() %>% head(n) }
LLEGIR.VARIABLES<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_variables_analitiques_20181123_172533.rds"))%>% as_tibble() %>% head(n) }
LLEGIR.CLINIQUES<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_variables_cliniques_20181123_172533.rds"))%>% as_tibble() %>% head(n) }
LLEGIR.VISITES<-function(n=Nmostra) {
readRDS("dades/sidiap" %>% here::here("ECV_CAT_entregable_visites_20181123_172533.rds"))%>% as_tibble() %>% head(n) }
## Llegir
Nmostra<-Inf
# Funció per seleccionar mostra random
PACIENTS<-Inf %>% LLEGIR.PACIENTS()
pacients_mostra<-mostreig_ids(PACIENTS,"idp",n_mostra = 400000)
rm(PACIENTS)
saveRDS(pacients_mostra,file="./dades_test/pacients_mostra.rds")
# Salvar_en sudirectori
PROBLEMES<-Nmostra %>% LLEGIR.PROBLEMES()
PROBLEMES_mostra<-pacients_mostra %>% select(idp) %>% inner_join(PROBLEMES,by="idp")
CMBDH<-Nmostra %>% LLEGIR.CMBDH()
CMBDH_mostra<-pacients_mostra %>% select(idp) %>% inner_join(CMBDH,by="idp")
CMBDH.padris<-Nmostra %>% LLEGIR.padris()
CMBDH.padris_mostra<-pacients_mostra %>% select(idp) %>% inner_join(CMBDH.padris,by="idp")
CMBDH_PROC<-Nmostra %>% LLEGIR.PROC()
CMBDH_PROC_mostra<-pacients_mostra %>% select(idp) %>% inner_join(CMBDH_PROC,by="idp")
rm(CMBDH)
rm(CMBDH_PROC)
rm(CMBDH.padris)
gc()
saveRDS(PROBLEMES_mostra,file="./dades_test/PROBLEMES_mostra.rds")
saveRDS(CMBDH_mostra,file="./dades_test/CMBDH_mostra.rds")
saveRDS(CMBDH.padris_mostra,file="./dades_test/CMBDH.padris_mostra.rds")
saveRDS(CMBDH_PROC_mostra,file="./dades_test/CMBDH_PROC_mostra.rds")
# Variables ---------------
VARIABLES<-Nmostra %>% LLEGIR.VARIABLES() %>% select(idp,cod,val,dat)
VARIABLES_mostra<-pacients_mostra %>% select(idp) %>% inner_join(VARIABLES,by="idp")
rm(VARIABLES)
gc()
saveRDS(VARIABLES_mostra,file="./dades_test/VARIABLES_mostra.rds")
rm(VARIABLES_mostra)
# Cliniques ---------------
CLINIQUES<-Nmostra %>% LLEGIR.CLINIQUES()
CLINIQUES_mostra<-pacients_mostra %>% select(idp) %>% inner_join(CLINIQUES,by="idp")
rm(CLINIQUES)
gc()
saveRDS(CLINIQUES_mostra,file="./dades_test/CLINIQUES_mostra.rds")
# TAbac -------------
TABAC<-Nmostra %>% LLEGIR.TABAC ()
TABAC_mostra<-pacients_mostra %>% select(idp) %>% inner_join(TABAC,by="idp")
rm(TABAC)
gc()
saveRDS(TABAC_mostra,file="./dades_test/TABAC_mostra.rds")
# Farmacs facturats -------------
FX.FACTURATS<-Nmostra %>% LLEGIR.FX.FACTURATS()
FX.FACTURATS_mostra<-pacients_mostra %>% select(idp) %>% inner_join(FX.FACTURATS,by="idp")
rm(FX.FACTURATS)
gc()
saveRDS(FX.FACTURATS_mostra,file="./dades_test/FX.FACTURATS_mostra.rds")
# Farmacs prescrits -------------
FX.PRESCRITS<-Nmostra %>% LLEGIR.FX.PRESCRITS
FX.PRESCRITS_mostra<-pacients_mostra %>% select(idp) %>% inner_join(FX.PRESCRITS,by="idp")
rm(FX.PRESCRITS)
gc()
saveRDS(FX.PRESCRITS_mostra,file="./dades_test/FX.PRESCRITS_mostra.rds")
# VISITES ------------------
VISITES<-Nmostra %>% LLEGIR.VISITES()
VISITES_mostra<-pacients_mostra %>% select(idp) %>% inner_join(VISITES,by="idp")
rm(VISITES)
gc()
saveRDS(VISITES_mostra,file="./dades_test/VISITES_mostra.rds")
rm(VISITES_mostra)
# Seleccionar facturacions + prescripcions de la mostra de pacients ---------
Nmostra<-Inf
LLEGIR.PACIENTS<-function(n=Nmostra) {
readRDS("./dades/sidiap_test/pacients_mostra.rds") %>% as_tibble() %>% head(n)}
pacients_mostra<-Inf %>% LLEGIR.PACIENTS()
# Obrir base de dades total de facturacions
# Farmacs facturats -------------
FX.FACTURATS<-Nmostra %>% LLEGIR.FX.FACTURATS()
FX.FACTURATS_mostra<-pacients_mostra %>% select(idp) %>% inner_join(FX.FACTURATS,by="idp")
rm(FX.FACTURATS)
gc()
saveRDS(FX.FACTURATS_mostra,file="dades/sidiap_test" %>% here::here("FX.FACTURATS_mostra.rds"))
rm(FX.FACTURATS_mostra)
# Farmacs prescrits -------------
FX.PRESCRITS<-Nmostra %>% LLEGIR.FX.PRESCRITS
FX.PRESCRITS_mostra<-pacients_mostra %>% select(idp) %>% inner_join(FX.PRESCRITS,by="idp")
rm(FX.PRESCRITS)
gc()
saveRDS(FX.PRESCRITS_mostra,file="dades/sidiap_test" %>% here::here("FX.PRESCRITS_mostra.rds"))
|
d88e27f4f2af5ed0ebe643ceeb8cfe255fe17185
|
4fbef04d36ac1cf8dcea9690b2b1f6916e1584e2
|
/Grant_project.R
|
a78c6cbdf1da1a32c6ff77d34eb461b13a868b12
|
[] |
no_license
|
geyu625/Grant_Prediction
|
d1b6e3546eeaa57a7490de88f6afea0f945bb6c2
|
7d03838a2fab7a4b568204422b28f74a00e674bb
|
refs/heads/master
| 2016-09-08T01:28:02.909756
| 2014-12-06T03:51:48
| 2014-12-06T03:51:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 19,026
|
r
|
Grant_project.R
|
############# ROC functions #############
ROC<-function(res){
# 1st column is class has 0 and 1 only
# 2nd colum is their scores
ord<-order(res[,2],decreasing=T)
score<-res[ord,2]
class<-res[ord,1]
temp1<-unique(score)
n2<-length(temp1)
n<-length(class)
class0<-which(class==0)
class1<-which(class==1)
n1<-length(class1)
n0<-length(class0)
Sen<-rep(0,(n2+1)) #Sensitivity
Spe<-rep(1,(n2+1)) #Specificity
for (i in 1:n2){
tmp1<-which(score>=temp1[i])
tmp2<-setdiff(1:n,tmp1)
Sen[(i+1)]<-length(intersect(tmp1,class1))/n1
Spe[(i+1)]<-length(intersect(tmp2,class0))/n0
}
out<-data.frame(Sen=Sen,Spe=Spe)
out
}
ROC.score<-function(Sen,Spe){
n<-length(Sen)-1
tmp1<-1-Spe
tmp2<-diff(tmp1,lag=1)
tmp3<-rep(0,n)
for (i in 1:n){ tmp3[i]<-(Sen[i]+Sen[(i+1)])/2 }
out<-tmp3%*%tmp2
out
}
##import data
temp1 <- read.csv("/home/alex/Documents/Stat project/Grant application/unimelb_training.csv",header = TRUE)
id <- temp1[,1]
y <- temp1[,2]
temp1 <- temp1[,-c(1,2)]
############# Distribution Analysis######
#cbind(colnames(temp1),seq(1:ncol(temp1)))
# 8708 rows, 252 observations
dim(temp1)
# colnames and dependent variable is Grant.Status
names(temp1)
# distribution of response variable(almost balanced)
# 0 1
# 4716 3992
table(y)
############# Data cleaning #############
### Start date
# chron library has days/years function
library(chron)
date0 <- as.Date(c("01/01/04"),"%d/%m/%y")
date1 <- as.Date(temp1[,4],"%d/%m/%y")
#date <- as.numeric(date1-date0)%%365
month <- months(date1)
day <- days(date1)
year <- as.numeric(years(date1)) - as.numeric(years(date0))
daytable <- table(day, y) # check contigency table of day and y
monthtable <- table(month, y)
yeartable <- table(year, y)
chisq.test(daytable) # independent test
chisq.test(monthtable)
chisq.test(yeartable)
### Sponsor code
spon.code1 <- as.character(temp1[,1])
spon.code1[spon.code1==""]<-"999" #Set the missing value to sponsor code 999
spon.cate <- unique(spon.code1)
spon.le <- length(spon.cate) #Number of sponsors
spon.numb <- rep(0,spon.le) #Number of applications for each sponsor
spon.numbs <- rep(0,spon.le) #Number of success applications for each sponsor
spon.rate <- rep(0,spon.le) #Success rate for each sponsor
for (i in 1:spon.le){
tmp1 <- which(spon.code1==spon.cate[i])
spon.numb[i] <- length(tmp1)
spon.numbs[i] <- length(which(y[tmp1]==1))
spon.rate[i] <- spon.numbs[i]/spon.numb[i]
}
spon.chis <- rep(0,spon.le) #Find the p-value of chi-square test for each sponsor
for (i in 1:spon.le){
if (spon.numb[i]<=2){
spon.chis[i] <- NA
}else {
tmp1 <- which(spon.code1==spon.cate[i])
tmp2 <- which(y[tmp1]==0)
if ((length(tmp2)==0)||length(tmp2)==length(tmp1)){
spon.chis[i] <- 0
} else{
spon.chis[i] <- chisq.test(table(spon.code1[tmp1],y[tmp1]))$p.value
}
}
}
#Big sponsors
spon.cate1 <- spon.cate[which(spon.numb>100)]
#Small and favor to success (collapse to one group)
spon.cate2 <- spon.cate[which((spon.numb<=100)&(spon.rate>.5)&(spon.chis<0.2))] # why compare to 0.2?
#Small and favor to failure (collapse to one group)
spon.cate3 <- spon.cate[which((spon.numb<=100)&(spon.rate<.5)&(spon.chis<0.2))]
#Small and no obvious preference or tiny sponsors (collapse to one group)
spon.cate4 <- spon.cate[which((spon.numb<=100)&(spon.chis>=0.2)|is.na(spon.chis))]
n <- nrow(temp1)
spon.code2 <- rep(NA,n)
for (i in 1:n){
tmp1 <- which(spon.cate1==spon.code1[i])
tmp2 <- length(which(spon.cate2==spon.code1[i]))
tmp3 <- length(which(spon.cate3==spon.code1[i]))
tmp4 <- length(which(spon.cate4==spon.code1[i]))
if (length(tmp1)==1){
spon.code2[i] <- spon.code1[i]
} else{
if (tmp2==1){
spon.code2[i] <- "AAA"
} else{
if (tmp3==1){
spon.code2[i] <- "BBB"
} else{
if (tmp4==1){spon.code2[i] <- "CCC"}
}
}
}
}
spon.code <- as.factor(spon.code2)
### Grant code
grant.code1 <- as.character(temp1[,2])
grant.code1[grant.code1==""] <- "999" #999 as missing value
granttable <- table(grant.code1,y)
grantmargintable <- margin.table(granttable,1)
grantproptable <- prop.table(granttable,1)
cbind(granttable,total = grantmargintable, prop = grantproptable[,1])
# 0 1 total prop
#10A 2478 1475 3953 0.6268657
#10B 251 196 447 0.5615213
#20A 60 68 128 0.4687500
#20C 202 205 407 0.4963145
#30A 0 3 3 0.0000000#
#30B 894 413 1307 0.6840092
#30C 150 208 358 0.4189944
#30D 126 52 178 0.7078652
#30E 6 5 11 0.5454545
#30F 1 0 1 1.0000000#
#30G 48 12 60 0.8000000
#40C 0 6 6 0.0000000#
#50A 337 600 937 0.3596585
#999 163 749 912 0.1787281
grant.code1[grant.code1=="30A"] <- "999"
grant.code1[grant.code1=="40C"] <- "999"
grant.code1[grant.code1=="30E"] <- "10B" #different from Dr. Li
grant.code1[grant.code1=="30F"] <- "30G" #different from Dr. Li
grant.code <- as.factor(grant.code1)
### Contract value
cvalue1 <- as.character(temp1[,3])
cvalue1[cvalue1==""] <- "999" #999 as missing value
contracttable <- table(cvalue1,y)
contractmargintable <- margin.table(contracttable,1)
contractproptable <- prop.table(contracttable,1)
cbind(contracttable,total = contractmargintable, prop = contractproptable[,1])
# 0 1 total prop
#999 2913 650 3563 0.8175695
#A 875 1601 2476 0.3533926
#B 332 326 658 0.5045593
#C 166 284 450 0.3688889
#D 121 318 439 0.2756264
#E 69 244 313 0.2204473
#F 58 208 266 0.2180451
#G 103 294 397 0.2594458
#H 37 41 78 0.4743590#
#I 14 7 21 0.6666667
#J 23 3 26 0.8846154
#K 0 6 6 0.0000000#
#L 0 2 2 0.0000000#
#M 1 1 2 0.5000000#
#O 1 1 2 0.5000000#
#P 2 0 2 1.0000000
#Q 1 6 7 0.1428571#
cvalue1[which((cvalue1=="H ") | (cvalue1 == "M ") | (cvalue1 == "O "))]<-"B "
cvalue1[which((cvalue1=="I ")|(cvalue1=="J ")|(cvalue1=="P "))]<-"999"
cvalue1[which((cvalue1=="K ")|(cvalue1=="L ")|(cvalue1=="Q "))]<-"F "
cvalue <- as.factor(cvalue1)
#####Number of success and failure####
nsuccess <- temp1[,34]
median <- summary(nsuccess)[3]
nsuccessind <- rep(0,length(nsuccess))
nsuccessind[which(is.na(nsuccess))] = 1
nsuccess[which(is.na(nsuccess))] = median
nfail <- temp1[,35]
median <- summary(nfail)[3]
nfailind <- rep(0,length(nfail))
nfailind[which(is.na(nfail))] = 1
nfail[which(is.na(nfail))] = median
######### Has PhD#####
has.PhD <- temp1$With.PHD.1
levels(has.PhD)
has.PhDtable <- table(has.PhD,y)
has.PhDtable
chisq.test(has.PhDtable)
######## Country ####
country <- temp1$Country.of.Birth.1
levels(country)
countrytable <- table(country,y)
countrytable
chisq.test(countrytable)
####### Has.ID ###
has.ID <- temp1$Person.ID.1
has.ID[which(!is.na(has.ID))] = 1 # is.na retruns a logical vector
has.ID[which(is.na(has.ID))] = 0 # have to handle non missing value first
has.IDtable <- table(has.ID,y)
has.IDtable
chisq.test(has.IDtable)
###### Role ###
role <- temp1$Role.1
levels(role)
roletable <- table(role,y)
role.margin.table <- margin.table(roletable,1)
role.prop.table <- prop.table(roletable,1)
cbind(roletable,sum = role.margin.table, prop0 = role.prop.table[,1])
chisq.test(roletable)
role[which(role == "")] = "DELEGATED_RESEARCHER" # Merge certain levels
role[which(role == "EXTERNAL_ADVISOR")] = "STUD_CHIEF_INVESTIGATOR"
role[which(role == "HONVISIT")] = "STUD_CHIEF_INVESTIGATOR"
# Department No.
dept <- as.factor(temp1$Dept.No..1)
###### Papers#########
Astar <- temp1$A..1
summary(Astar)
# range(Astar, na.rm = TRUE)
table(Astar,y)
median <- summary(Astar)[3]
Astarind <- rep(0,length(Astar))
Astarind[which(is.na(Astar))] = 1
Astar[which(is.na(Astar))] = median
A <- temp1$A.1
summary(A)
table(A,y)
median <- summary(A)[3]
Aind <- rep(0,length(A))
Aind[which(is.na(A))] = 1
A[which(is.na(A))] = median
B <- temp1$B.1
summary(B)
table(B,y)
median <- summary(B)[3]
Bind <- rep(0,length(B))
Bind[which(is.na(B))] = 1
B[which(is.na(B))] = median
C <- temp1$C.1
summary(C)
table(C,y)
median <- summary(C)[3]
Cind <- rep(0,length(C))
Cind[which(is.na(C))] = 1
C[which(is.na(C))] = median
A..col <- which(colnames(temp1) == "A..1" | colnames(temp1) == "A..2" |
colnames(temp1) == "A..3" | colnames(temp1) == "A..4" |
colnames(temp1) == "A..5" | colnames(temp1) == "A..6" |
colnames(temp1) == "A..7" | colnames(temp1) == "A..8" |
colnames(temp1) == "A..9" | colnames(temp1) == "A..10" |
colnames(temp1) == "A..11" | colnames(temp1) == "A..12" |
colnames(temp1) == "A..13" | colnames(temp1) == "A..14" |
colnames(temp1) == "A..15")
A.. <- temp1[,A..col]
maxAstar <- apply(A..,1,function(x) max(x,na.rm = TRUE))
table(maxAstar,y)
median <- summary(maxAstar)[3]
maxAstarind <- rep(0,length(maxAstar))
maxAstarind[which(maxAstar == -Inf)] = 1
maxAstar[which(maxAstar == -Inf)] = median
C.col <- which(colnames(temp1) == "C.1" | colnames(temp1) == "C.2" |
colnames(temp1) == "C.3" | colnames(temp1) == "C.4" |
colnames(temp1) == "C.5" | colnames(temp1) == "C.6" |
colnames(temp1) == "C.7" | colnames(temp1) == "C.8" |
colnames(temp1) == "C.9" | colnames(temp1) == "C.10" |
colnames(temp1) == "C.11" | colnames(temp1) == "C.12" |
colnames(temp1) == "C.13" | colnames(temp1) == "C.14" |
colnames(temp1) == "C.15")
C. <- temp1[,C.col]
maxC <- apply(C.,1,function(x) max(x,na.rm = TRUE))
table(maxC,y)
median <- summary(maxC)[3]
maxCind <- rep(0,length(maxC))
maxCind[which(maxC == -Inf)] = 1
maxC[which(maxC == -Inf)] = median
####Num of people involved ####
personcol <- which(colnames(temp1) == "Role.1" | colnames(temp1) == "Role.2" |
colnames(temp1) == "Role.3" | colnames(temp1) == "Role.4" |
colnames(temp1) == "Role.5" | colnames(temp1) == "Role.6" |
colnames(temp1) == "Role.7" | colnames(temp1) == "Role.8" |
colnames(temp1) == "Role.9" | colnames(temp1) == "Role.10" |
colnames(temp1) == "Role.11" | colnames(temp1) == "Role.12" |
colnames(temp1) == "Role.13" | colnames(temp1) == "Role.14" |
colnames(temp1) == "Role.15")
persons <- temp1[,personcol]
numPeople <- rowSums(persons != "", na.rm = TRUE)
numPeopletable <- table(numPeople,y)
numPeopletable
chisq.test(numPeopletable)
data1 <- data.frame(y=y,day = day, month = month, year = year,sponsor=spon.code,grant=grant.code,
cvalue=cvalue,nsuccess=nsuccess,nsuccessind = nsuccessind, nfail=nfail,nfailind = nfailind,
has.PhD = has.PhD, country = country, has.ID = has.ID, role = role, Astar = Astar,
Astarind = Astarind, A = A, Aind = Aind, B = B, Bind = Bind, C = C, Cind = Cind,
maxAstar = maxAstar, maxAstarind = maxAstarind, maxC = maxC, maxCind = maxCind,
numPeople = numPeople)
########## randomForest ###############
data1$y <- as.factor(data1$y)
library(randomForest)
library(caret)
library(pROC)
#tuning mtry
#tuneRF(x = data1[tra,2:ncol(data1)], y = data1[tra,1],trace = TRUE, ntreeTry = 1000, stepFactor = 1.5, improve = 0.0000001, plot = TRUE, doBest = FALSE,)
#mtry OOBError
#3.OOB 3 0.1085714
#4.OOB 4 0.1057143
#5.OOB 5 0.1078571
#7.OOB 7 0.1082857
set.seed(1) #set the random seed, so that you can repeat the same results
ind <- sample(1:nrow(data1),size=nrow(data1),replace=F)
tra <- ind[1:7000]
val <- ind[7001:nrow(data1)]
gbmGrid <- expand.grid(mtry = c(3,4,5,6))
nrow(gbmGrid)
#fitControl <- trainControl(method = "repeatedcv", number = 10, repeats = 10)
ptm <- proc.time()
set.seed(2)
rfFit2 <- train(x = data1[tra,2:ncol(data1)], y = data1[tra,1],method = "rf", tuneGrid = gbmGrid)
(proc.time()-ptm)/60 # 19 mins
rfFit2
#plot(rfFit2,cex.axis = 5)
plot(rfFit2,cex.axis = 5, xlab = "Number of Randomly Selected Predictors")
ptm <- proc.time()
set.seed(1)
newdata1_A.rf <- randomForest (x = data1[tra,2:ncol(data1)], y = data1[tra,1], mtry = 4, importance = TRUE)
(proc.time()-ptm)/60
print(newdata1_A.rf) # OOB: 10.73%
#plot(newdata1_A.rf, main = "Random Forest Error Rate VS Number of Trees")
#plot(newdata1_A.rf, xlab = "Trees", main = NULL)
par(mar = c(3.7,5,0.7,2), mgp = c(2.5,0.8,0))
matplot(1:newdata1_A.rf$ntree, newdata1_A.rf$err.rate, type = "l", xlab = "Trees", ylab = "Error")
legend("topright", inset = 0.1, c("Error Rate", "5% CI Upper Bound", "5% CI Lower Bound"), lty = c(1,2,2), col = c("black", "red","green"),
bty = "n")
pred1 <- predict(newdata1_A.rf,data1[val,2:ncol(data1)],type = "prob")[,2]
pred2<- as.numeric(pred1>=0.5)
true <- data1[val,1]
temp3 <- cbind.data.frame(pred2,true)
error <- (nrow(temp3)-length(which(temp3[,1]==temp3[,2])))/nrow(temp3)
error #when mtry = 4, error is 0.1018735;
#when mtry = 5, error is 0.09894614
#temp<-ROC(cbind.data.frame(data1[val,1],pred1)) #factor 0/1 converts to 1/2 in cbind
#as.vector(ROC.score(temp$Sen,temp$Spe)) #0.9409988
rf.ROC <- roc(data1[val,1],pred1)
par(las = 1,mgp = c(3,1,0),mar = c(5.1,5.1,4.1,2.1), oma = c(1,2,0,0))
dev.off()
plot(rf.ROC, print.auc = FALSE, col = "red", print.thres.adj=c(1,-0.5), print.auc.adj=c(-1.5,5),
cex = 0.7, ylab = NA)
##used to adjust the distance between axis labels and tick mark labels
mtext(side = 2, "Sensitivity",las = 0, line = 2.3)
#plot(rf.ROC,asp = NA, pin = c(2,2))
#variable importance
#par(las = 1,mgp = c(2,3,0),mar = c(5,6,2,2))
#varImpPlot(newdata1_A.rf, sort = TRUE, main = NULL, type = 1,cex = 0.6)
imp <- importance(newdata1_A.rf, type = 1)
imp.order <- imp[order(imp[,1], decreasing = TRUE),]
#par(las = 1,mgp = c(3,1,0),mar = c(5.1,4.1,4.1,2.1))
#dotchart(imp.order, labels = names(imp.order), xlab = "Relative Importance", cex = 0.4)
library(Hmisc)
par(mar = c(3,2,0.5,2), mgp = c(2.5,0.8,0))
dotchart2(imp.order, labels = names(imp.order), xlab = "Relative Importance of RF",
width.factor = 3, dotsize =2, pch = 21, cex = 0.75)
##GBM
library(gbm)
set.seed(1) #set the random seed, so that you can repeat the same results
ind <- sample(1:nrow(data1),size=nrow(data1),replace=F)
tra <- ind[1:7000]
val <- ind[7001:nrow(data1)]
####tuning parameters ####
data1$y <- as.factor(data1$y)
library(caret)
library(e1071)
gbmGrid <- expand.grid(interaction.depth = c(6,8,10), n.trees = (15:20)*50,shrinkage = c(0.02,0.03))
nrow(gbmGrid)
fitControl <- trainControl(method = "repeatedcv", number = 5, repeats = 5)
ptm <- proc.time()
set.seed(2)
gbmFit2 <- train(x = data1[tra,2:ncol(data1)], y = data1[tra,1],method = "gbm", verbose = FALSE,
tuneGrid = gbmGrid)
(proc.time()-ptm)/60
gbmFit2
#The final values used for the model were n.trees
#= 200, interaction.depth = 9 and shrinkage = 0.01.
#interaction.depth = seq(1,10,1), n.trees = (1:20)*50,shrinkage = seq(0,0.01,0.001)
#The final values used for the model were n.trees
#= 1000, interaction.depth = 10 and shrinkage = 0.01.
#The final values used for the model were n.trees
#= 900, interaction.depth = 8 and shrinkage = 0.02.
#The final values used for the model were n.trees
#= 1000, interaction.depth = 10 and shrinkage = 0.02.
#########
nu <- 0.001
D <- 3
data1 <- data.frame(y=y,day = day, month = month, year = year,sponsor=spon.code,grant=grant.code,
cvalue=cvalue,nsuccess=nsuccess,nsuccessind = nsuccessind, nfail=nfail,nfailind = nfailind,
has.PhD = has.PhD, country = country, has.ID = has.ID, role = role, Astar = Astar,
Astarind = Astarind, A = A, Aind = Aind, B = B, Bind = Bind, C = C, Cind = Cind,
maxAstar = maxAstar, maxAstarind = maxAstarind, maxC = maxC, maxCind = maxCind,
numPeople = numPeople)
set.seed(1)
fit.gbm<-gbm.fit(data1[tra,2:ncol(data1)], data1[tra,1], n.tree=500, interaction.depth=D,
shrinkage=nu, distribution="bernoulli", verbose=FALSE) # How to choose these parameters
best.iter<-gbm.perf(fit.gbm, plot.it=FALSE, method="OOB")
while(fit.gbm$n.trees-best.iter<50){
fit.gbm<-gbm.more(fit.gbm, 100) # do another 50 iterations
best.iter<-gbm.perf(fit.gbm,plot.it=FALSE,method="OOB")
}
best.iter
pred1<- predict.gbm(fit.gbm,data1[val,2:ncol(data1)],n.trees = best.iter,type="response")
pred2<- as.numeric(pred1>=0.5)
tab <- table(data1[val,1],pred2)
tab
(tab[1,2]+tab[2,1])/sum(tab) #0.1282201
gbm.ROC <- roc(data1[val,1],pred1)
plot(gbm.ROC, add = TRUE, print.auc = FALSE, col = "blue",
lty = 2, cex = 0.7 )
legend("bottomright", inset = 0.05, c("RF", "GBM"), lty = c(1,2), col = c("red", "blue"),
bty = "n")
# variable importance
#par(las = 1,mgp = c(1.5,0.3,0),mar = c(5,7,2,2), cex= 0.75) #mgp: adjust margin of axis, label
imp2 <- summary(fit.gbm, n.trees = best.iter, plotit = FALSE)
imp2.order <- imp2[order(imp2[,2], decreasing = TRUE),]
#par(las = 1,mgp = c(3,1,0),mar = c(5.1,4.1,4.1,2.1))
library(Hmisc)
#par(mar = c(4,0,2,4), mgp = c(2.5,0.3,0))
par(mar = c(3,2,0.5,2), mgp = c(2.5,0.8,0))
dotchart2(imp2.order$rel.inf, labels = rownames(imp2.order), xlab = "Relative Importance of GMB",
width.factor = 3, dotsize =2, pch = 21, cex = 0.75)
# Cvalue
cvaluetable <- table(data1$y,data1$cvalue)
#par(las = 1,mgp = c(2.5,0.3,0),mar = c(5,7,2,2), cex= 0.75)
par(mar = c(3.7,6,0.5,2), mgp = c(2.5,0.8,0))
barplot(cvaluetable, main= NULL,
xlab="Contract Value", ylab = "Counts", col=c("darkblue","red"),
legend = rownames(cvaluetable), beside=TRUE)
nsuccesstable <- table(data1$y,data1$nsuccess)
barplot(nsuccesstable, main=NULL,
xlab="Number of Success History", ylab = "Counts", col=c("darkblue","red"),
legend = rownames(nsuccesstable), beside=TRUE)
sponsortable <- table(data1$y,data1$sponsor)
barplot(sponsortable, main=NULL,
xlab="Sponsor", ylab = "Counts", col=c("darkblue","red"),
legend = rownames(sponsortable), beside=TRUE)
#rookie
temp <- cbind.data.frame(nsuccess,nfail,y)
temp1 <- temp[which(temp$nfail == 0) ,]
temp2 <- temp1[which(temp1$nsuccess == 0) ,]
rookietable <- table(temp2$y)
barplot(rookietable, main=NULL,
xlab="Rookie", ylab = "Counts", col = NA)
par(mar = c(3.7,6,1.5,2), mgp = c(2.5,0.8,0))
nfailtable <- table(data1$y,data1$nfail)
barplot(nfailtable, main=NULL,
xlab="Number of Fail History", ylab = "Counts", col=c("darkblue","red"),
legend = rownames(nfailtable), beside=TRUE)
par(mar = c(3.7,5,0.5,2), mgp = c(2.5,0.8,0))
monthtable <- table(data1$y,factor(data1$month,levels=month.name))
#legend(xjust = 1.5)
#par(las = 1,mgp = c(2,0.3,0),mar = c(5,7,2,2), cex= 0.75)
barplot(monthtable, main= NULL,
xlab="Month", ylab = "Counts", col=c("darkblue","red"),
legend = rownames(monthtable), beside=TRUE)
|
1944682decb459d0198ba35913d1f18780646e79
|
13e11079ba6fcd554a2f6015cd4e40204d1cb292
|
/man/make_post_request.Rd
|
2109d6b378812ef365448fc0e568a5a834e35d0d
|
[
"MIT"
] |
permissive
|
hut34/hutr-package
|
cdae26631d0f4e640b7c22f1eff703692a47b8ad
|
3519c7f5acc5fe2bdb12a96f42539542ecd11b32
|
refs/heads/master
| 2020-12-28T18:33:10.945324
| 2020-04-24T03:25:38
| 2020-04-24T03:25:38
| 238,440,955
| 1
| 0
| null | null | null | null |
UTF-8
|
R
| false
| true
| 763
|
rd
|
make_post_request.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/make_post_request.R
\name{make_post_request}
\alias{make_post_request}
\title{Make post requests}
\usage{
make_post_request(Endpoint, Body = "EMPTY")
}
\arguments{
\item{Endpoint}{A string.}
\item{Body}{A string.}
}
\value{
The response to the post request is returned as a list.
}
\description{
\code{make_post_request} sends a post request to the hut.
}
\details{
This function sends a post request to the hut after first adding tokens to the body of the post.
It first adds access and ID tokens to the body of the post.
}
\examples{
make_post_request(Endpoint = "/alive")
make_post_request(Endpoint = "/user/downloadFile", Body = paste0("\"dataSetId\":\"", myDatasetID,"\""))
}
|
22e98ef39a5d72899de2bc2317e3cd99262f230b
|
ec4e6203ede2ce496e506aac5973bf260dd6ad27
|
/server.R
|
087ef1f07d790a227532a0f6f2d06384beafd713
|
[] |
no_license
|
stevejgoodman/mortgagepossessions
|
755bf4ccc54a815c66acf05fdb9b263aaa1c100a
|
f060aec2f39eb03abc74ce554ea62d59c4db2caa
|
refs/heads/master
| 2020-04-26T23:12:27.409000
| 2015-03-03T13:46:33
| 2015-03-03T13:46:33
| 31,610,836
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 712
|
r
|
server.R
|
# This is the server logic for a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#
library(shiny)
library(ggplot2)
library(dplyr)
load("data/londonrepossessions.RData")
shinyServer(function(input, output) {
# reactive({
#
# })
output$distPlot <- renderPlot({
indata= filter(lnd_fnew, year == input$yearselected)
fillvar=input$varselected
ggplot(data = indata, aes_string(x = "long", y = "lat", fill = as.name(fillvar), group = "group")) +
geom_polygon() +
geom_path(colour="black", lwd=0.05) +
coord_equal() +
scale_fill_gradient2(low = "green", mid = "grey", high = "red", midpoint = 0)
})
})
|
9f1bcea0dc3bbcb42ed4dadd6d79e810f26ca82c
|
0db9b9ad4b00a908d9ddba1f157d2d3bba0331c4
|
/examples/st_union_ext.R
|
bd1ff92a60383b65722aab5c1d4fd9bef6fc4627
|
[
"MIT"
] |
permissive
|
elipousson/sfext
|
c4a19222cc2022579187fe164c27c78470a685bb
|
bbb274f8b7fe7cc19121796abd93cd939279e30a
|
refs/heads/main
| 2023-08-18T15:29:28.943329
| 2023-07-19T20:16:09
| 2023-07-19T20:16:09
| 507,698,197
| 16
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 144
|
r
|
st_union_ext.R
|
nc <- read_sf_path(system.file("shape/nc.shp", package = "sf"))
nc_union <- st_union_ext(nc[10:15,], name_col = "NAME")
nc_union
plot(nc_union)
|
eaa75046135bf8a08e4a52604d2200ab590300d2
|
b3d2d2634c15b7b61df06a25b17514ef26b0637c
|
/PPMI/code/utility.R
|
98a9ce75ef137a1328d2332912748ed36b329767
|
[] |
no_license
|
LifeScienceDataAnalytics/VirtualCohorts
|
2feae9553ce0234b1c2ac80e84aa45482b82ca8c
|
030c9200b1972a8f7c25a7865bc8e17cb88b9211
|
refs/heads/master
| 2020-09-10T02:15:00.783422
| 2019-11-26T10:09:18
| 2019-11-26T10:09:18
| 221,623,940
| 1
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 17,341
|
r
|
utility.R
|
# Replace INF value with NA
remove.inf = function(cohortdata){
is.na(cohortdata) = sapply(cohortdata , is.nan)
is.na(cohortdata) = sapply(cohortdata , is.infinite)
return(cohortdata)
}
# Get stats on group
get_stats_on_column_number = function(cohortdata){
mydata = cohortdata
updrs_data = grep("UPDRS_", colnames(mydata), value = TRUE)
Medicalhistory_data = grep("MedicalHistory_", colnames(mydata), value = TRUE)
nmotor_data = grep("NonMotor_", colnames(mydata), value = TRUE)
RBD_data = grep("RBD_", colnames(mydata), value = TRUE)
CSF_data = grep("CSF_", colnames(mydata), value = TRUE)
Biological_data = grep("Biological_", colnames(mydata), value = TRUE)
Imaging_data = grep("Imaging.", colnames(mydata), value = TRUE)
count_matrix = setNames(data.frame(matrix(ncol = 7, nrow = 0)), c("UPDRS", "MedicalHistory","NonMotor", "RBD", "CSF","Biological","Imaging"))
count_matrix = rbind(count_matrix, data.frame("UPDRS" = length(updrs_data),
"MedicalHistory"= length(Medicalhistory_data),
"NonMotor" = length(nmotor_data),
"RBD" = length(RBD_data),
"CSF" = length(CSF_data),
"Biological" = length(Biological_data),
"Imaging" = length(Imaging_data)))
#rownames(count_matrix) = gsub(".*_.*_", "", colnames(mydata)[1])
return(count_matrix)
}
# Auxiliary variables keep track of visit-wise and group-wise patient dropout.
# Measurements of features are marked by value missing not at random (MNAR).
# MNAR results from a systematic absence of subject data for a measurement type (feature group).
get_aux_all_groups = function( cohortdata){
mysample = cohortdata
timepoint = str_extract(colnames(mysample), "V[0-9][0-9]")[1]
UPDRS = select(mysample,grep( "UPDRS",colnames(mysample),value=TRUE))
MedicalHistory = select(mysample,grep( "MedicalHistory",colnames(mysample),value=TRUE))
NonMotor = select(mysample,grep( "NonMotor",colnames(mysample),value=TRUE))
CSF = select(mysample,grep( "CSF",colnames(mysample),value=TRUE))
RBD = select(mysample,grep( "RBD",colnames(mysample),value=TRUE))
Biological = select(mysample,grep( "Biological",colnames(mysample),value=TRUE))
Imaging = select(mysample,grep( "Imaging",colnames(mysample),value=TRUE))
output_aux = function(mysubsample){
#return_df = data.frame()
#groupname = deparse(substitute(a))
if(dim(mysubsample)[2] != 0 ){
if(dim(mysubsample)[2]== 1){
mysubsample = mysubsample
}else{
# Add a new column for AUX
new = "new"
in.loop = mysubsample
mysubsample[new] <- 0
# Get rownames where all value is NA
mysubsample_NA = which(apply(in.loop, 1, function(x) all(is.na(x))))
mysubsample_pat = names(mysubsample_NA)
if(length(mysubsample_pat) !=0 ){
mysubsample[which(rownames(mysubsample) %in% mysubsample_pat ),]$new <- 1
# Annoate aux column with group name and visit number
groupName = sub("_.*$", "", colnames(mysubsample)[1])
new2 = paste(groupName,"aux",timepoint, sep = "_")
colnames(mysubsample)[which(names(mysubsample) == "new")] <- new2
print(paste0("Aux available for ", groupName, "at" ,timepoint ))
}else{
mysubsample$new = NULL
groupName = sub("_.*$", "", colnames(mysubsample)[1])
print(paste0("Aux unavailable for ", groupName, "at" ,timepoint ))}
}
}else{ print(paste0("Missing group at",timepoint ))}
return(mysubsample)
}
UPDRS_aux = output_aux(mysubsample = UPDRS)
MedicalHistory_aux = output_aux(mysubsample = MedicalHistory)
NonMotor_aux = output_aux(mysubsample = NonMotor)
CSF_aux = output_aux(mysubsample = CSF)
RBD_aux = output_aux(mysubsample = RBD)
Biological_aux = output_aux(mysubsample = Biological)
Imaging_aux = output_aux(mysubsample = Imaging)
outputdf <- data.frame(matrix("removelater", ncol = 1, nrow = nrow(mysample)))
names(outputdf)[1]<- "toremove"
if(dim(UPDRS)[2] != 0 ){
outputdf = as.data.frame(cbind(outputdf , UPDRS_aux))
} else{
print(paste0("UPDRS data unavailable for visit", timepoint))
}
if(dim(MedicalHistory)[2] != 0 ){
outputdf = as.data.frame(cbind(outputdf , MedicalHistory_aux))
} else{
print(paste0("MedicalHistory data unavailable for visit", timepoint))
}
if(dim(NonMotor)[2] != 0 ){
outputdf = as.data.frame(cbind(outputdf , NonMotor_aux))
} else{
print(paste0("NonMotor data unavailable for visit", timepoint))
}
if(dim(CSF)[2] != 0 ){
outputdf = as.data.frame(cbind(outputdf , CSF_aux))
} else{
print(paste0("CSF data unavailable for visit", timepoint))
}
if(dim(RBD)[2] != 0 ){
outputdf = as.data.frame(cbind(outputdf , RBD_aux))
} else{
print(paste0("RBD data unavailable for visit", timepoint))
}
if(dim(Biological)[2] != 0 ){
outputdf = as.data.frame(cbind(outputdf , Biological_aux))
} else{
print(paste0("Biological data unavailable for visit", timepoint))
}
if(dim(Imaging)[2] != 0 ){
outputdf = as.data.frame(cbind(outputdf , Imaging_aux))
} else{
print(paste0("Imaging data unavailable for visit", timepoint))
}
outputdf$toremove = NULL
#print("Aux done")
return(outputdf)
}
# Autoencode
get_meta_feature_autoencoder = function(group_data , timepoint, groupname ){
#groupdata = as.data.frame(cbind(group_data, data.frame(y=y_variable) ))
h2o.init(nthreads = -1)
myx = as.h2o(group_data)
n = round(dim(group_data)[2] /2)
m = round(dim(group_data)[2] /4)
#n = runif(1, min=20000000, max=99999999)
r = sample(20:70000000, 1)
hyper_params <- list(activation=c("Rectifier","TanhWithDropout"), #RectifierWithDropout","TanhWithDropout","MaxoutWithDropout"
hidden = list(1, c(n, 1), c(n,m,1), c(m,1)), # make it dynamic
input_dropout_ratio=c(0, 0.05, 0.2, 0.5),
#l1=seq(0,1e-4,1e-6),
#l2=seq(0,1e-4,1e-6)
l2=10^c(-4:4))
grid = h2o.grid("deeplearning",
grid_id = paste("mygrid", r, sep="_"),
x=colnames(myx),
autoencoder = TRUE,
training_frame=myx,
seed=1234567,
stopping_metric="MSE",
stopping_rounds=5,
epochs=500,
hyper_params = hyper_params, categorical_encoding = "AUTO")
gbm_sorted_grid <- h2o.getGrid(grid_id = paste("mygrid", r, sep="_"), sort_by = "mse")
print(gbm_sorted_grid)
fit <- h2o.getModel(gbm_sorted_grid@model_ids[[1]])
nlayers = length(strsplit(substr(gbm_sorted_grid@summary_table[1,1], 2, nchar(gbm_sorted_grid@summary_table[1,1])-1), ",")[[1]])
newvar = as.data.frame(h2o.deepfeatures(fit, myx, nlayers))
colnames(newvar) = paste(groupname , timepoint, sep= "_")
output = list("model" = fit, "meta_feature" = newvar, "nlayers" = nlayers, "modelID" = gbm_sorted_grid@model_ids[[1]] )
h2o.saveModel(fit, path = "Auto_Model" )
h2o.shutdown(prompt = FALSE)
return(output)
}
# Autencoded value for MedicalHistory, NonMotor and Biological groups at every visit
visit_autoencoded = function(cohort_data){
Biological_features = select(cohort_data, grep("Biological", colnames(cohort_data), value = TRUE ))
NonMotor_features = select(cohort_data, grep("NonMotor", colnames(cohort_data), value = TRUE ))
MedicalHistory_features = select(cohort_data, grep("MedicalHistory", colnames(cohort_data), value = TRUE ))
if( dim(Biological_features)[2] > 1){
groupName = sub("_.*$", "", colnames(Biological_features)[1])
Visit = str_extract(colnames(Biological_features), "V[0-9][0-9]")[1]
Biological_meta = get_meta_feature_autoencoder(group_data = Biological_features , timepoint = Visit, groupname = groupName)
}
gc()
if( dim(NonMotor_features)[2] > 1){
groupName = sub("_.*$", "", colnames(NonMotor_features)[1])
Visit = str_extract(colnames(NonMotor_features), "V[0-9][0-9]")[1]
NonMotor_meta = get_meta_feature_autoencoder(group_data = NonMotor_features , timepoint = Visit, groupname = groupName)
}
gc()
if( dim(MedicalHistory_features)[2] > 1){
groupName = sub("_.*$", "", colnames(MedicalHistory_features)[1])
Visit = str_extract(colnames(MedicalHistory_features), "V[0-9][0-9]")[1]
MedicalHistory_meta = get_meta_feature_autoencoder(group_data = MedicalHistory_features , timepoint = Visit, groupname = groupName)
}
gc()
meta_list = list("Biological_meta" = Biological_meta,
"NonMotor_meta" = NonMotor_meta,
"MedicalHistory_meta" = MedicalHistory_meta)
return(meta_list)
}
# blacklist-whitelist
blacklist_whitelist = function(discPCA2){
#discPCA2 = dics_data
all.columns = colnames(discPCA2)
visit11 = grep(".*_V11",all.columns,value=TRUE)
visit10 = grep(".*_V10",all.columns,value=TRUE)
visit09 = grep(".*_V09",all.columns,value=TRUE)
visit08 = grep(".*_V08",all.columns,value=TRUE)
visit07 = grep(".*_V07",all.columns,value=TRUE)
visit06 = grep(".*_V06",all.columns,value=TRUE)
visit05 = grep(".*_V05",all.columns,value=TRUE)
visit04 = grep(".*_V04",all.columns,value=TRUE)
visit03 = grep(".*_V03",all.columns,value=TRUE)
visit02 = grep(".*_V02",all.columns,value=TRUE)
visit01 = grep(".*_V01",all.columns,value=TRUE)
visitbl = grep(".*_V00",all.columns,value=TRUE)
visitSNP = grep("SNP_",all.columns,value=TRUE)
visitAUX = grep("aux",all.columns,value=TRUE)
visitpat = grep("Patient",all.columns,value=TRUE)
visitbl = setdiff(visitbl, visitpat)
# features not covered in thes vists are :
all = c(visitbl,visit01, visit02,visit03,visit04,visit05, visit06, visit07, visit08, visit09 , visit10 , visit11)
#---- Blacklist timepoint t+1 to t ------
bl = data.frame()
# From 11
from11 = c(visitbl, visit01, visit02, visit03, visit04, visit05, visit06, visit07, visit08, visit09, visit10 )
for(im in from11){
bl = rbind.data.frame(bl, data.frame( from=visit11, to=rep(im, each=length(visit11))))
}
from10 = c(visitbl, visit01, visit02, visit03, visit04, visit05, visit06, visit07, visit08, visit09 )
for(im in from10){
bl = rbind.data.frame(bl, data.frame( from=visit10, to=rep(im, each=length(visit10))))
}
from09 = c(visitbl, visit01, visit02, visit03, visit04, visit05, visit06, visit07, visit08 )
for(im in from09){
bl = rbind.data.frame(bl, data.frame(from=visit09, to=rep(im, each=length(visit09))))
}
from08 = c(visitbl, visit01, visit02, visit03, visit04, visit05, visit06, visit07 )
for(im in from08){
bl = rbind.data.frame(bl, data.frame(from=visit08, to=rep(im, each=length(visit08))))
}
from07 = c(visitbl, visit01, visit02, visit03, visit04, visit05, visit06 )
for(im in from07){
bl = rbind.data.frame(bl, data.frame(from=visit07, to=rep(im, each=length(visit07))))
}
from06 = c(visitbl, visit01, visit02, visit03, visit04, visit05)
for(im in from06){
bl = rbind.data.frame(bl, data.frame(from=visit06, to=rep(im, each=length(visit06))))
}
from05 = c(visitbl, visit01, visit02, visit03, visit04)
for(im in from05){
bl = rbind.data.frame(bl, data.frame(from=visit05, to=rep(im, each=length(visit05))))
}
from04 = c(visitbl, visit01, visit02, visit03)
for(im in from04){
bl = rbind.data.frame(bl, data.frame(from=visit04, to=rep(im, each=length(visit04))))
}
from03 = c(visitbl, visit01, visit02)
for(im in from03){
bl = rbind.data.frame(bl, data.frame(from=visit03, to=rep(im, each=length(visit03))))
}
from02 = c(visitbl, visit01)
for(im in from02){
bl = rbind.data.frame(bl, data.frame(from=visit02, to=rep(im, each=length(visit02))))
}
from01 = c(visitbl)
for(im in from01){
bl = rbind.data.frame(bl, data.frame(from=visit01, to=rep(im, each=length(visit01))))
}
bl$from <- as.character(bl$from)
bl$to <- as.character(bl$to)
#---------------------------------------------------------------------------------------------------------
# From all longitudinal data to non-longitudinal data----
bl2 = data.frame()
nonL.data = setdiff(all.columns , all)
from.all.Ldata = all
for(im in nonL.data){
bl2 = rbind.data.frame(bl2, data.frame(from = from.all.Ldata, to = rep(im, each=length(from.all.Ldata))))
}
bl2$from <- as.character(bl2$from)
bl2$to <- as.character(bl2$to)
#---------- Blacklist within biomarker group-------
bl4 = data.frame()
# updrs
from.updrs = grep("UPDRS",all.columns,value=TRUE)
to.updrs = grep("Patient|MedicalHistory|NonMotor|Biological|SNP|CSF|RBD",all.columns,value=TRUE)
for(im in to.updrs){
bl4 = rbind.data.frame(bl4, data.frame(from=from.updrs, to=rep(im, each=length(from.updrs))))
}
#bio CHECKß
from.bio = grep("Biological|CSF",all.columns,value=TRUE)
to.bio = grep("Patient|SNP",all.columns,value=TRUE)
for(im in to.bio){
bl4 = rbind.data.frame(bl4, data.frame(from = from.bio, to=rep(im, each=length(from.bio))))
}
#Img ADD later
from.img = grep("Imaging",all.columns,value=TRUE)
to.img = grep("Biological|CSF|MedicalHistory|NonMotor|RBD|UPDRS|Patient|SNP",all.columns,value=TRUE)
for(im in to.img){
bl4 = rbind.data.frame(bl4, data.frame(from = from.img, to=rep(im, each=length(from.img))))
}
#Patient
from.patient = grep("Patient_", all.columns, value = TRUE)
to.patient = grep("SNP|Patient", all.columns, value = TRUE)
for(im in to.patient){
bl4 = rbind.data.frame(bl4, data.frame(from = from.patient, to=rep(im, each=length(from.patient))))
}
#Non motor
from.nmotor = grep("NonMotor|RBD",all.columns,value=TRUE)
to.nmotor = grep("SNP|Patient|MedicalHistory|Biological|CSF",all.columns,value=TRUE)
for(im in to.nmotor){
bl4 = rbind.data.frame(bl4, data.frame(from=from.nmotor, to=rep(im, each=length(from.nmotor))))
}
# MedicalHistory
from.medicalhist = grep("MedicalHistory",all.columns,value=TRUE)
to.medicalhis = grep("SNP|Patient|Biological|CSF",all.columns,value=TRUE)
for(im in to.medicalhis){
bl4 = rbind.data.frame(bl4, data.frame(from=from.medicalhist, to=rep(im, each=length(from.medicalhist))))
}
#SNP
from.SNP = grep("SNP", all.columns, value = TRUE)
to.SNP = grep("Patient_GENDER|Patient_SimpleGender|Patient_ENROLL_AGE", all.columns, value = TRUE)
for(im in to.SNP){
bl4 = rbind.data.frame(bl4, data.frame(from = from.SNP, to=rep(im, each=length(from.SNP))))
}
#Patient_GENDER can only influence Patient_SimpleGender
from.gender = grep("Patient_GENDER", all.columns, value = TRUE)
to.gender = setdiff(all.columns , "Patient_SimpleGender" )
for(im in to.gender){
bl4 = rbind.data.frame(bl4, data.frame(from = from.gender, to=rep(im, each=length(from.gender))))
}
bl4$from <- as.character(bl4$from)
bl4$to <- as.character(bl4$to)
#======================== From aux to aux----
bl3 = data.frame()
#1. General aux to aux
aux_columns = grep("aux" ,all.columns, value= TRUE )
all_aux_again = grep("aux" ,all.columns, value= TRUE )
non_aux = setdiff(all.columns, aux_columns)
#non_aux = setdiff(grep("UPDRS", all.columns, value = TRUE), aux_columns)
for(im in aux_columns){
bl3 = rbind.data.frame(bl3, data.frame(from = all_aux_again, to = rep(im, each=length(all_aux_again))))
}
for(imm in all_aux_again){
bl3 = rbind.data.frame(bl3, data.frame(from = non_aux, to = rep(imm, each=length(non_aux))))
}
for(immm in non_aux){
bl3 = rbind.data.frame(bl3, data.frame(from = all_aux_again, to = rep(immm, each=length(all_aux_again))))
}
bl3$from <- as.character(bl3$from)
bl3$to <- as.character(bl3$to)
# remove whitelist pair from blacklist pairs
#================================================================================
dt_bl = rbind(bl,bl2,bl4,bl3)
#Whitelist aux column to those that created them.
#====== whitelist=======
aux_columns = grep("aux" ,all.columns, value= TRUE )
non_aux = setdiff(all.columns, aux_columns)
dt_wl = data.frame()
for(i in aux_columns){
groupname = stringr::str_extract(i, "CSF|Biological|UPDRS|MedicalHistory|NonMotor")
timepoint_loop = stringr::str_extract(i, "V00|V01|V02|V03|V04|V05|V06|V07|V08|V09|V10|V11")
get_node = grep(timepoint_loop , grep(groupname , non_aux, value = TRUE), value = TRUE)
dt_wl = rbind.data.frame(dt_wl, data.frame(from = i, to = get_node) )
}
output = list("blacklist" = dt_bl, "whitelist" = dt_wl)
return(output)
}
|
b0db2b5956b173e65f3b8487da21077e41ebb809
|
dd8132404e8c7b028cb13cba904c50aace01c6a7
|
/swt/src/lib/swt/src/mapsu.r
|
62eb1d4b934c519477716db76cfefbddb23b45e7
|
[] |
no_license
|
arnoldrobbins/gt-swt
|
d0784d058fab9b8b587f850aeccede0305d5b2f8
|
2922b9d14b396ccd8947d0a9a535a368bec1d6ae
|
refs/heads/master
| 2020-07-29T09:41:19.362530
| 2019-10-04T11:36:01
| 2019-10-04T11:36:01
| 209,741,739
| 15
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 747
|
r
|
mapsu.r
|
# mapsu --- map standard unit to file descriptor
file_des function mapsu (std_unit)
file_des std_unit
include SWT_COMMON
integer i
mapsu = std_unit
if (mapsu > 0) # this test added for execution speed
return
do i = 1, 10
select (mapsu)
when (STDIN1)
mapsu = Std_port_tbl (1)
when (STDIN2)
mapsu = Std_port_tbl (3)
when (STDIN3)
mapsu = Std_port_tbl (5)
when (STDOUT1)
mapsu = Std_port_tbl (2)
when (STDOUT2)
mapsu = Std_port_tbl (4)
when (STDOUT3)
mapsu = Std_port_tbl (6)
else
return
return (TTY) # infinite definition -- send back TTY
end
|
76e7720cf9087c33281f1e279ac5da98a8c53ac1
|
aa568620651abe6dc515d4afa65ef2fb1b90cfdd
|
/man/concurrent_trades.Rd
|
21d9d4e9d6be4cf653c18e06853f4ff2179d9c5a
|
[] |
no_license
|
IanMadlenya/tastytrade
|
9bf9c9ada3895f8e7f4558a03516bd4dea31eaa1
|
37f4f255995171460476ac34e790762d0c76a155
|
refs/heads/master
| 2020-04-13T03:25:53.500470
| 2018-10-12T23:46:36
| 2018-10-12T23:46:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| true
| 1,093
|
rd
|
concurrent_trades.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/concurrent_trades.R
\name{concurrent_trades}
\alias{concurrent_trades}
\title{Calculate # concurrent trades for each day}
\usage{
concurrent_trades(sy, st, en)
}
\arguments{
\item{sy}{character string representing stock symbol for group and join later}
\item{st}{character string understood by lubridate ymd to represent open date of trade}
\item{en}{character string understood by lubridate ymd to represent closing date of trade}
}
\value{
dataframe of dates when position was open including stock symbol
head(concurrent_trades("SPY", "2018-01-01", "2018-02-16"))
symbol quote_date exit_date
SPY 2018-01-01 2018-02-16
SPY 2018-01-02 2018-02-16
SPY 2018-01-03 2018-02-16
SPY 2018-01-04 2018-02-16
SPY 2018-01-05 2018-02-16
SPY 2018-01-06 2018-02-16
}
\description{
{
Number of trades open on any given day can be used to calculate when multiple
entries would cause more capital allocated to a strategy by symbol than desired
}
}
\examples{
concurrent_trades("SPY", "2018-01-01", "2018-02-16")
Function ----
}
|
e3a61179abafd4714b85c34bf9f7f3bb2adf004b
|
d99c2492a9298c4d602f346c1ec123a1cd20e30f
|
/R-script/r-script_disease_causing_genes_filtering_V2_with_english_comments.R
|
28911ea97182f053a3c8c043b79c84935dd475d4
|
[] |
no_license
|
CjanH/Bioinformatics-project
|
593d397289537786263f81528656ed0d663d4e4d
|
f7822eeefc227617436d2ffd5533ace152834fcf
|
refs/heads/master
| 2022-11-02T19:08:09.692985
| 2020-06-16T09:09:17
| 2020-06-16T09:09:17
| 263,006,490
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,871
|
r
|
r-script_disease_causing_genes_filtering_V2_with_english_comments.R
|
################
#READING + CLEANING FILE
my_data <- read.delim("r_script_input.txt")
df <- subset(my_data, select = -c(X.Uploaded_variation,
IMPACT,
Feature,
BIOTYPE,
HGVSc,
HGVSp,
Codons,
Existing_variation,
DISTANCE,
STRAND,
FLAGS,
SYMBOL_SOURCE,
MANE,
TSL,
APPRIS,
AF,
CLIN_SIG,
SOMATIC,
PHENO,
MOTIF_NAME,
MOTIF_POS,
HIGH_INF_POS,
MOTIF_SCORE_CHANGE
))
################
#FILTERS everything that doesn't contain missense mutation, high PolyPhen score and low Sift score:
df1 <- df[grep("missense_variant", df$Consequence),]
df2 <- df1[grep("damaging", df1$PolyPhen),]
df3 <- df2[grep("deleterious", df2$SIFT),]
#LOADING GENE LIST
genlist <- read.csv("gene_list.csv")
col1 <- genlist[[1]] #Genes must all be in column 1!#################################################
#Removing genes except for the ones from list
genfilter <- df3[grep(paste0(col1, collapse = "|"), df3$SYMBOL),]
write.table(genfilter, file="output_Filtered_on_PolyPhen_Sift.csv", sep=",", row.names=FALSE)
#Deleting Dupes
distinct_list <- genfilter[!duplicated(genfilter$SYMBOL), ]
write.table(distinct_list, file="output_Filtered_on_PolyPhen_Sift_GENELIST.csv", sep=",", row.names=FALSE)
################
#FILTERS everything that doesn't contain missense mutation and high PolyPhen score:
genfilter2 <- df2[grep(paste0(col1, collapse = "|"), df2$SYMBOL),]
write.table(genfilter2, file="output_Filtered_on_PolyPhen.csv", sep=",", row.names=FALSE)
#Deleting Dupes
distinct_list2 <- genfilter2[!duplicated(genfilter2$SYMBOL), ]
write.table(distinct_list2, file="output_Filtered_on_PolyPhen_GENELIST.csv", sep=",", row.names=FALSE)
################
#FILTERS everything that doesn't contain missense mutation and low Sift score:
df4 <- df1[grep("deleterious", df1$SIFT),]
genfilter3 <- df4[grep(paste0(col1, collapse = "|"), df4$SYMBOL),]
write.table(genfilter3, file="output_Filtered_on_Sift.csv", sep=",", row.names=FALSE)
#Deleting Dupes
distinct_list3 <- genfilter3[!duplicated(genfilter3$SYMBOL), ]
write.table(distinct_list3, file="output_Filtered_on_Sift_GENELIST.csv", sep=",", row.names=FALSE)
|
ab13b744df1c6b23400c62460b28aa49c70439f8
|
bafdfcab4680d5208d451021f833f51b50ad2700
|
/R/CorpusCoder.R
|
9c21726d1339824261cd45eb989c7130bf35fe17
|
[] |
no_license
|
denis-arnold/AcousticNDLCodeR
|
b973c79c06efd3a3614e0b681a977b0a74d44f09
|
488f9a6300b23cb0aa93bbe51eeee9d764a982fd
|
refs/heads/master
| 2021-01-24T20:58:16.335997
| 2018-07-06T15:42:16
| 2018-07-06T15:42:16
| 123,262,982
| 0
| 2
| null | 2018-02-28T15:19:04
| 2018-02-28T09:37:05
|
R
|
UTF-8
|
R
| false
| false
| 4,187
|
r
|
CorpusCoder.R
|
#' Codes a corpus for use with NDL with vector of wavefile names and a vector of TextGrid names provided
#' @param Waves Vector with names (and full path to if not in wd) of the wave files.
#' @param Annotations Vector with names (and full path to if not in wd) of the TextGrid files.
#' @param AnnotationType Type of annotation files. Suported formats are praat TextGrids (set to "TextGrid") and ESPS/Wavesurfer (set to "ESPS") files.
#' @param TierName Name of the tier in the TextGrid to be used.
#' @param Dismiss Regular expression for Outcomes that should be removed. Uses grep.
#' E.g. "<|>" would remove <noise>,<xxx>, etc. Default is NULL.
#' @param Encoding Encoding of the annotation file. It is assumed, that all annotation files have the same encoding.
#' @param Fast Switches between a fast and a robust TextGrid parser.
#' For Fast no "\\n" or "\\t" may be in the transcription. Default is FALSE.
#' @param Cores Number of cores that the function may use. Default is 1.
#' @param IntensitySteps Number of steps that the intensity gets compressed to. Default is 5
#' @param Smooth A parameter for using the kernel smooth function provied by the package zoo.
#' @return A data.frame with $Cues and $Outcomes for use with ndl or ndl2.
#' @examples
#' \dontrun{
#' # assuming the corpus contains wave files and praat textgrids
#'
#' setwd(~/Data/MyCorpus) # assuming everything is in one place
#'
#' #assuming you have one wav for each annotation
#'
#' Waves=list.files(pattern="*.wav",recursive=T)
#' Annotations=list.files(pattern="*.TextGrids",recursive=T) # see above
#'
#' # Lets assume the annotation is in UTF-8 and you want everything from a tier called words
#' # Lets assume tha you want to dismiss everything in <|>
#' # Lets assume that have 4 cores available
#' # Lets assume that you want the defaut settings for the parameters
#'
#' Data=CorpusCoderCorpusCoder(Waves, Annotations, AnnotationType = "TextGrid",
#' TierName = "words", Dismiss = "<|>", Encoding, Fast = F, Cores = 4,
#' IntensitySteps = 5, Smooth = 800)
#'
#' }
#' @import tuneR
#' @import seewave
#' @import parallel
#' @export
#' @author Denis Arnold
CorpusCoder=function(Waves,Annotations,AnnotationType=c("TextGrid","ESPS"),TierName=NULL,Dismiss=NULL,Encoding,Fast=F,Cores=1,IntensitySteps,Smooth){
WaveHandling=function(val,IntensitySteps,Smooth){
start=Part$start[val]
end=Part$end[val]
Cues=makeCues(Wave[(start*16000):(end*16000)],IntensitySteps,Smooth)
return(Cues)
}
WholeData=data.frame(Outcomes=character(),
start=numeric(),
end=numeric(),
file=character(),
Cues=character(),
stringsAsFactors=F)
if(length(Waves)!=length(Annotations)){
stop("Length of lists does not match!")
}
for(i in 1:length(Waves)){
if(AnnotationType=="ESPS"){
Part=readESPSAnnotation(Annotations[i],Encoding)
}else{
if(Fast){
TG=readTextGridFast(Annotations[i],Encoding)
}else{
TG=readTextGridRobust(Annotations[i],Encoding)
}
if(!(TierName%in%TG[[1]])){
stop(paste0("TierName ",TierName," is not present in TextGrid:", Annotations[i]))
}
Part=TG[[which(TG[[1]]==TierName)+1]]
if(length(Part$Outcomes)<2) next
}
Part$File=Waves[i]
Part$Prev=c("<P>",Part$Outcomes[1:(length(Part$Outcomes)-1)])
if(!is.null(Dismiss)){
if(length(grep(Dismiss,Part$Outcomes))>0){
Part=Part[-grep(Dismiss,Part$Outcomes),]
}
}
if(length(Part$Outcomes)==0) next
Wave=readWave(Waves[i])
if(Wave@samp.rate!=16000){
if(Wave@samp.rate<16000){
warning("Sampling rate below 16 kHz!")
}
Wave=resamp(Wave,f=Wave@samp.rate,g=16000,output="Wave")
}
X=mclapply(1:dim(Part)[1],WaveHandling,IntensitySteps,Smooth,mc.cores=Cores)
Part$Cues=unlist(X)
WholeData=rbind(WholeData,Part)
}
return(WholeData)
}
|
95b82577fccf4055da56bae01d782ff43eca97f4
|
774381d571d3a6fb484e4865004354f5c583af5e
|
/plot4.R
|
0291abfb2725994ba39e9e47ac6e5448929b2d0b
|
[] |
no_license
|
dreamingofdata/ExData_Plotting1
|
6be99e44a33d83b6e36146e6445e519514942c4f
|
1dbe70aeab63028a675f4ff53d9b5e5e71791f50
|
refs/heads/master
| 2021-01-23T20:38:07.159217
| 2015-09-13T19:47:52
| 2015-09-13T19:47:52
| 42,358,627
| 0
| 0
| null | 2015-09-12T13:51:20
| 2015-09-12T13:51:20
| null |
UTF-8
|
R
| false
| false
| 2,406
|
r
|
plot4.R
|
library(data.table) #Needed for fread()
library(dplyr) #Needed for mutate() and filter9)
#Fast read of data file
df <- fread("data/household_power_consumption.txt")
#We're interested only in a few days, so first filter on the two days
# want and perform additional manipulations afterwards
df <- filter(df, Date == '1/2/2007' | Date == '2/2/2007')
#Create a new variable 'datetime' to add to the dataframe
# Note, discovered that package dplyr does not handle POSIClt well,
# hence the forced conversion to POSIXct
df <- mutate(df, datetime = as.POSIXct(strptime(paste(df$Date, df$Time),
'%d/%m/%Y %H:%M:%S')))
#During fread() all numeric columns defaulted to characters because of the
# handful of missing values stored as '?'
#Convert these back to numeric
df <- mutate(df, Global_active_power=as(Global_active_power, "numeric"))
df <- mutate(df, Global_reactive_power=as(Global_reactive_power, "numeric"))
df <- mutate(df, Voltage=as(Voltage, "numeric"))
df <- mutate(df, Global_intensity=as(Global_intensity, "numeric"))
df <- mutate(df,Sub_metering_1=as(Sub_metering_1, "numeric"))
df <- mutate(df,Sub_metering_2=as(Sub_metering_2, "numeric"))
df <- mutate(df,Sub_metering_3=as(Sub_metering_3, "numeric"))
windows.options(width=480, height=480)
#Establish a png graphics device
png(file="plot4.png")
#Set up the next 4 plots as a 2 x 2 grid
par(mfrow = c(2, 2), mar = c(4, 4, 2, 1))
#Plot 1
with(df, plot(datetime,
Global_active_power,
type="l",
xlab="",
ylab = "Global Active Power (kilowatts)"))
#Plot 2
with(df, plot(datetime,
Voltage,
type="l",
xlab = "datetime",
ylab = "Voltage"))
#Plot 3
plot(df$datetime,
df$Sub_metering_1,
type="l",
xlab="",
ylab = "Energy sub metering")
lines(df$datetime,
df$Sub_metering_2,
col='red')
lines(df$datetime,
df$Sub_metering_3,
col='blue')
legend(x="topright",
legend = c("Sub_metering_1", "Sub_metering_2", 'Sub_metering_3'),
lwd = 1,
col=c("black","red","blue"))
#Plot 4
with(df, plot(datetime,
Global_reactive_power,
type="l",
xlab = "datetime",
ylab = "Global_reactive_power"))
#Make sure to close the graphics device
dev.off()
|
78f9e1307c40e339f4fee3e67653038d18a14fd2
|
0a906cf8b1b7da2aea87de958e3662870df49727
|
/diceR/inst/testfiles/indicator_matrix/libFuzzer_indicator_matrix/indicator_matrix_valgrind_files/1609959313-test.R
|
1621f0c03ae4ab54f00ffb578b6d6c3d706454eb
|
[] |
no_license
|
akhikolla/updated-only-Issues
|
a85c887f0e1aae8a8dc358717d55b21678d04660
|
7d74489dfc7ddfec3955ae7891f15e920cad2e0c
|
refs/heads/master
| 2023-04-13T08:22:15.699449
| 2021-04-21T16:25:35
| 2021-04-21T16:25:35
| 360,232,775
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 619
|
r
|
1609959313-test.R
|
testlist <- list(x = c(1.06551740006207e-255, NaN, NaN, NaN, NaN, -2.80469303061826e+76, 1.51289250225832e-284, 2.12199579047121e-314, 7.30002231499092e-304, NaN, 1.33113092106461e-105, NaN, -1.99999999999996, -2.8341039789705e-139, 1.37200275505855e+161, -5.88201331363396e+72, 3.1314413995112e-294, -8.89435856500296e+298, NaN, 6.89707872881208e-307, NaN, -5.72989227692856e+303, NaN, 7.2911220195564e-304, 2.18007600065929e-106, 2.52496950157743e-29, 5.48684429329591e-310, 2.12199579096527e-314, 1.87271700705218e-257, -3.52054867972031e+305))
result <- do.call(diceR:::indicator_matrix,testlist)
str(result)
|
cf70daba7d8339e9c1ac9bda1e6dfa39f46729a0
|
9c496c45dae557ec0e3eb413f8230a0437f0d13e
|
/bak/7_tmod/make_radar_plots.R
|
e5dd83b08dbb3eaa022bac0517c9ff6c457aa493
|
[] |
no_license
|
Chenmengpin/inferCC
|
dab23239e5727f6da0cd4a19197ee9ebbd46438b
|
e81713687f9e14d39f9e1d531c7fe1db14cab7a4
|
refs/heads/master
| 2023-02-08T01:03:25.193943
| 2020-12-30T07:44:52
| 2020-12-30T07:44:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 5,110
|
r
|
make_radar_plots.R
|
library(openxlsx)
library(stringr)
library(fmsb)
library(Seurat)
library(reshape2)
library(dplyr)
library("wesanderson")
set.seed(1)
format_radar_matrix <- function(object, meta) {
meta$genes = as.character(meta$genes)
# mat = MinMax(object@scale.data[as.character(meta$genes), , drop = FALSE], -2.5, 2.5)
mat = object@scale.data[as.character(meta$genes), , drop = FALSE]
mat = melt(as.matrix(mat))
colnames(mat) <- c("genes", "cell", "value")
# temp_mat = melt(as.matrix(object@raw.data[as.character(meta$genes), , drop = FALSE]))
# mat <- mat[temp_mat[,3] != 0, ]
# print(head(mat))
# print(head(meta))
expr <- merge(meta, mat, by = "genes")
expr$PatientID = object@meta.data[expr$cell, "PatientID"]
# print(head(expr))
data = as.data.frame(
expr %>%
dplyr::select(stage, PatientID, value) %>%
dplyr::group_by(stage, PatientID) %>%
mutate(val=mean(value)) %>%
dplyr::select(stage, PatientID, val) %>%
unique()
)
data = dcast(data, stage~PatientID, value.var = "val")
rownames(data) <- data$stage
data <- data[, colnames(data) != "stage"]
data[is.na(data)] <- floor(min(data[!is.na(data)])) - 1
return(as.data.frame(t(data)))
}
make_radar_plots <- function(object, meta, group.by = "Stage", output_prefix=NULL) {
current_stages = sapply(meta$stage, function(x) {
return(str_split(x, "\\.")[[1]][2])
})
current_stages = intersect(as.character(object@meta.data[, group.by]), current_stages)
for(i in current_stages) {
print(i)
temp_meta = object@meta.data[as.character(object@meta.data[, group.by]) == i, ]
obj <- CreateSeuratObject(
object@raw.data[, rownames(temp_meta), drop = FALSE],
meta = temp_meta
)
obj@scale.data = object@scale.data[, rownames(temp_meta), drop = FALSE]
expr = format_radar_matrix(obj, meta)
expr <- rbind(
rep(ceiling(max(expr)), ncol(expr)),
rep(floor(min(expr)), ncol(expr)),
expr
)
expr = expr[, sort(colnames(expr))]
# print(expr)
if (!is.null(output_prefix)) {
png(paste(output_prefix, "_", i, "_radar.png", sep = ""), width = 12, height = 6, res = 600, units = "in")
}
par(
mfrow=c(1, 2),
bty='n',
oma = c(0.5,0.5,0,0) + 0.1,
mar = c(1,0,0,1) + 0.1
)
legend_labels = rownames(expr)
legend_labels = legend_labels[3: length(legend_labels)]
colors_border = wes_palette("Zissou1", length(legend_labels), type = "continuous")
radarchart(expr, axistype=1,
#custom polygon
pcol=colors_border, # pfcol=colors_in, plwd=4 , plty=1,
#custom the grid
cglcol="grey", cglty=1, axislabcol="grey",
caxislabels=seq(expr[2, 1], expr[1, 1], (expr[1, 1] - expr[2, 1]) / 5), cglwd=0.8,
#custom labels
vlcex=0.8
)
plot(0, col="white", cex=0, axes=F, ann=FALSE)
legend(
"left",
legend = legend_labels,
bty = "n", pch=20 ,
col=colors_border ,
text.col = "grey",
cex=1.2,
pt.cex=3,
ncol = 2
)
if (!is.null(output_prefix)) {
dev.off()
}
}
}
args = commandArgs(trailingOnly = T)
module = read.xlsx(args[1], sheet = 2)
obj = readRDS(args[2])
cell_name = args[4]
# select cells from specific disease
disease = str_split(cell_name, "_")[[1]]
disease = disease[length(disease)]
# patients = obj@meta.data[obj@meta.data$Disease == disease, ]
# patients = unique(patients$PatientID)
cells = rownames(obj@meta.data[obj@meta.data$Disease == disease, ])
temp_obj <- CreateSeuratObject(
obj@raw.data[, cells, drop = F],
meta = obj@meta.data[cells, , drop = F]
)
temp_obj@scale.data = obj@scale.data[, cells, drop = F]
temp_module = module[module$Cell_name == cell_name, , drop=F]
# print(head(temp_module))
# format meta
meta = NULL
for(j in 1:nrow(temp_module)) {
stage = paste("M", temp_module[j, "Stage"], temp_module[j, "Mfuzz_ID"], sep = ".")
# print(temp_module[j, "Genes"])
genes = str_split(temp_module[j, "Genes"], "\\|")[[1]]
meta = rbind(meta, data.frame(stage=stage, genes=genes))
# print(head(meta))
}
# print(meta)
# two random select groups
if(length(unique(meta$stage)) < 3) {
for(i in 1:2) {
temp = data.frame(
stage = paste("R", i, sep = ""),
genes = sample(
rownames(obj@raw.data)[!rownames(obj@raw.data) %in% meta$genes],
min(100, sum(!rownames(obj@raw.data) %in% meta$genes))
)
)
# print(head(temp))
meta = rbind(meta, temp)
}
}
# format and plot
make_radar_plots(object = temp_obj, meta = meta, group.by = "Stage", output_prefix = args[3])
|
69457504533a0550a5be910408df860e3278ec6d
|
acce3b266e5a9cd836fd8e9c7a9c347b53c0cc36
|
/R/DPdistance.R
|
a008277b1907cf9bc943cb2386610068ba48b490
|
[] |
no_license
|
cran/GMPro
|
377692648551235df7fa039ed966db0500c6dc59
|
fd90ff902acf861c30afc29bf2468a09c339faf7
|
refs/heads/master
| 2022-11-19T04:57:23.356602
| 2020-06-25T13:00:02
| 2020-06-25T13:00:02
| 276,688,996
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,919
|
r
|
DPdistance.R
|
#' calculate degree profile distances between 2 graphs.
#'
#' This function constructs empirical distributions of degree profiles for each
#' vertex and then calculate distances between each pair of vertices, one from
#' graph \emph{A} and the other from graph \emph{B}. The default distance used is the
#' 1-Wasserstein distance.
#'
#' @param A,B Two 0/1 adjacency matrices.
#' @param fun Optional function that computes distance between two distributions.
#' @return A distance matrix. Rows represent nodes in graph \emph{A} and columns
#' represent nodes in graph \emph{B}. Its \emph{(i, j)} element is the
#' distance between \eqn{i \in A} and \eqn{i \in B}.
#' @importFrom transport wasserstein1d
#' @importFrom stats rbinom
#' @examples
#' set.seed(2020)
#' n = 10; q = 1/2; s = 1; p = 1
#' Parent = matrix(rbinom(n*n, 1, q), nrow = n, ncol = n)
#' Parent[lower.tri(Parent)] = t(Parent)[lower.tri(Parent)]
#' diag(Parent) <- 0
#' ### Generate graph A
#' dA = matrix(rbinom(n*n, 1, s), nrow = n, ncol=n);
#' dA[lower.tri(dA)] = t(dA)[lower.tri(dA)]
#' A1 = Parent*dA
#' tmp = rbinom(n, 1, p)
#' n.A = length(which(tmp == 1))
#' indA = sample(1:n, n.A, replace = FALSE)
#' A = A1[indA, indA]
#' ### Generate graph B
#' dB = matrix(rbinom(n*n, 1, s), nrow = n, ncol=n);
#' dB[lower.tri(dB)] = t(dB)[lower.tri(dB)]
#' B1 = Parent*dB
#' tmp = rbinom(n, 1, p)
#' n.B = length(which(tmp == 1))
#' indB = sample(1:n, n.B, replace = FALSE)
#' B = B1[indB, indB]
#' DPdistance(A, B)
#' @export
##############################################################################################################
## DP.wasserstein is the function that matches 2 graphs via the W1 distances between nodes' degree profiles ##
##############################################################################################################
DPdistance = function(A, B, fun = NULL){
# Inputs:
# A and B: 2 symmetric adjacency matrices of graphs that will be matched with each other.
# Remark: graph A and graph B may not have same size.
# A and B have the following properties:
# i) symmetrix
# ii) diagonals = 0
# iii) positive entries = 1
# Output:
# W: n.A by n.B matrix, where each entry denotes the wassertein distance between the corresponding node in
# graph A and the node in graph B.
# Require Packages: transport.
# exclude all wrong possibilities
if(!isSymmetric(A)) stop("Error! A is not symmetric!");
if(!isSymmetric(B)) stop("Error! B is not symmetric!");
n.A = dim(A)[1];
n.B = dim(B)[1];
outa = apply(A, 1, sum);
outb = apply(B, 1, sum);
W = matrix(0, nrow = n.A, ncol = n.B);
for (i in 1: n.A){
temp_a = outa[A[i, ] != 0]
if(is.null(fun)){
W[i,] = apply(B, 1, function(x) wasserstein1d(temp_a, outb[x!=0]));
}
else{
W[i,] = apply(B, 1, function(x) fun(temp_a, outb[x!=0]));
}
}
return(W)
}
|
7080c20d901dc9fc33c49d340d593702e491364e
|
23660ade69cb1c41b49a8a86e6c4197cab331ffa
|
/man/sero1kmvec.Rd
|
2eca9e7738fdffe6248a409e88ac57a1d73eb4b2
|
[] |
no_license
|
FelipeJColon/SpatialDengue
|
e4c871557ec94a6786c683e2054e3b3958e7dff8
|
a130214a52796093e6682973ba922ab7b8c04719
|
refs/heads/master
| 2023-05-31T18:53:40.367373
| 2020-11-26T15:46:11
| 2020-11-26T15:46:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| true
| 682
|
rd
|
sero1kmvec.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sero1kmvec.R
\docType{data}
\name{sero1kmvec}
\alias{sero1kmvec}
\title{Proportion immune in Singapore in vector format}
\format{A vector of proportion immune per pixel
\describe{
\item{value}{proportion immune in pixel}
}}
\source{
\url{https://doi.org/10.1093/aje/kwz110}
\url{https://www.singstat.gov.sg/publications/population-trends}
}
\usage{
sero1kmvec
}
\description{
The same as "sero" but aggregated to 1km x 1km (instead of 100m x 100m) using mean valeus over the area and converted to vector format. For use on servers that do not support "rgdal" or "raster" packages
}
\keyword{datasets}
|
8a8656bcc536ad6429491c0a96af24404ed37063
|
97e3baa62b35f2db23dcc7f386ed73cd384f2805
|
/inst/app/helper.R
|
9b7713e6b59bbf5708856630a74d5f65c88fa347
|
[] |
no_license
|
conservation-decisions/smsPOMDP
|
a62c9294fed81fcecc4782ac440eb90a299bca44
|
48b6ed71bdc7b2cb968dc36cd8b2f18f0e48b466
|
refs/heads/master
| 2021-06-25T22:23:31.827056
| 2020-10-27T08:56:07
| 2020-10-27T08:56:07
| 161,746,931
| 7
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 3,176
|
r
|
helper.R
|
library(magrittr)
## MODALS OF PARAMETERS#####
modal_p0 <-
bsplus::bs_modal(
id = "modal_p0",
title = "Local probability of persitance : P(extant/extant, survey or stop)",
body = shiny::includeMarkdown(system.file("markdown", "modal_p0.md", package = "smsPOMDP")),
size = "medium"
)
modal_pm <-
bsplus::bs_modal(
id = "modal_pm",
title = "Local probability of persitance if manage : P(extant/extant, manage)",
body = shiny::includeMarkdown(system.file("markdown", "modal_pm.md", package = "smsPOMDP")),
size = "medium"
)
modal_d0 <-
bsplus::bs_modal(
id = "modal_d0",
title = "Local probability of detection : P(present/extant, stop)",
body = shiny::includeMarkdown(system.file("markdown", "modal_d0.md", package = "smsPOMDP")),
size = "medium"
)
modal_dm <-
bsplus::bs_modal(
id = "modal_dm",
title = "Local probability of detection : P(present/extant, manage)",
body = shiny::includeMarkdown(system.file("markdown", "modal_dm.md", package = "smsPOMDP")),
size = "medium"
)
modal_ds <-
bsplus::bs_modal(
id = "modal_ds",
title = "Local probability of detection if survey : P(present/extant, survey)",
body = shiny::includeMarkdown(system.file("markdown", "modal_ds.md", package = "smsPOMDP")),
size = "medium"
)
modal_V <-
bsplus::bs_modal(
id = "modal_V",
title = "Estimated economic value of the species ($/yr)",
body = shiny::includeMarkdown(system.file("markdown", "modal_V.md", package = "smsPOMDP")),
size = "medium"
)
modal_Cm <-
bsplus::bs_modal(
id = "modal_Cm",
title = "Estimated cost of managing ($/yr)",
body = shiny::includeMarkdown(system.file("markdown", "modal_Cm.md", package = "smsPOMDP")),
size = "medium"
)
modal_Cs <-
bsplus::bs_modal(
id = "modal_Cs",
title = "Estimated cost of survey ($/yr)",
body = shiny::includeMarkdown(system.file("markdown", "modal_Cs.md", package = "smsPOMDP")),
size = "medium"
)
modal_initial_belief <-
bsplus::bs_modal(
id = "modal_initial_belief",
title = "Initial belief state",
body = shiny::includeMarkdown(system.file("markdown", "modal_initial_belief.md", package = "smsPOMDP")),
size = "medium"
)
modal_Tmanage <-
bsplus::bs_modal(
id = "modal_Tmanage",
title = "Duration of past data (time steps)",
body = shiny::includeMarkdown(system.file("markdown", "modal_Tmanage.md", package = "smsPOMDP")),
size = "medium"
)
modal_Tsim <-
bsplus::bs_modal(
id = "modal_Tsim",
title = "Duration of simulation (time steps)",
body = shiny::includeMarkdown(system.file("markdown", "modal_Tsim.md", package = "smsPOMDP")),
size = "medium"
)
modal_case_study <-
bsplus::bs_modal(
id = "modal_case_study",
title = "Case of study",
body = shiny::includeMarkdown(system.file("markdown", "modal_case_study.md", package = "smsPOMDP")),
size = "medium"
)
modal_gif <-
bsplus::bs_modal(
id = "modal_gif",
title = "Help to select actions and observations",
body = shiny::includeMarkdown(system.file("markdown", "modal_gif.md", package = "smsPOMDP")),
size = "large"
)
|
9a717086749e2f61a0864c429933521dc47234da
|
ac4c2eece3d103aef1c4ab29f071fa142c67798d
|
/data/uswb/writetabular.R
|
fcb0426360e535194986559f2b4c6914c52c532e
|
[] |
no_license
|
opengeospatial/ELFIE
|
9afc85552610a3be0d2396e3e0b848e7e4479ef0
|
e7107e9ef70d0ea294e97122871c57f7fb15b6a3
|
refs/heads/master
| 2023-05-10T22:42:10.167267
| 2021-05-27T15:29:31
| 2021-05-27T15:29:31
| 90,381,360
| 2
| 5
| null | 2020-06-03T01:53:42
| 2017-05-05T13:58:13
|
JavaScript
|
UTF-8
|
R
| false
| false
| 9,358
|
r
|
writetabular.R
|
setwd("~/Documents/Projects/ELFIE/ELFIE/data/uswb/")
library(jsonlite)
library(dplyr)
huc12pp <- fromJSON("usgs_huc12pp_uswb.json")
huc12boundary <- fromJSON("usgs_huc12boundary_uswb.json")
nhdplusflowline <- fromJSON("usgs_nhdplusflowline_uswb.json")
nwis_sites <- fromJSON("usgs_nwissite_uswb.json")
huc_nwis <- readr::read_delim("huc_nwis.csv", delim = "\t")
nwis_sites$features$properties <-dplyr::left_join(nwis_sites$features$properties, huc_nwis, by = c("site_no" = "nwis"))
hucs <- huc12pp$features$properties$HUC_12
### huc12boundary_info
preds <- c("jsonkey_huc12", "rdfs:type", "schema:name",
"schema:description", "schema:sameAs", "schema:image")
huc12boundary_info <- data.frame(matrix(nrow = length(hucs), ncol = length(preds)))
names(huc12boundary_info) <- preds
rownames(huc12boundary_info) <- huc12boundary$features$properties$huc12
huc12boundary_info$jsonkey_huc12 <- rownames(huc12boundary_info)
huc12boundary_info$`rdfs:type` <- "http://www.opengeospatial.org/standards/waterml2/hy_features/HY_CatchmentDivide"
huc12boundary_info$`schema:name` <- huc12boundary$features$properties$name
huc12boundary_info$`schema:description` <- "comment describing each watershed at a high level"
huc12boundary_info$`hyf:realizedCatchment` <- paste0("elfie/usgs/huc12/uswb/", huc12boundary$features$properties$huc12)
write.table(huc12boundary_info, file = "usgs_huc12boundary_uswb.tsv", sep = "\t", row.names = F)
### huc12pp_info
preds <- c("jsonkey_HUC_12", "rdfs:type", "schema:name",
"schema:description", "schema:sameAs", "schema:image",
"hyf:contributingCatchment", "hyf:nexusRealization")
huc12pp_info <- data.frame(matrix(nrow = length(hucs), ncol = length(preds)))
names(huc12pp_info) <- preds
rownames(huc12pp_info) <- huc12pp$features$properties$HUC_12
huc12pp_info$jsonkey_HUC_12 <- rownames(huc12pp_info)
huc12pp_info$`rdfs:type` <- "http://www.opengeospatial.org/standards/waterml2/hy_features/HY_HydroNexus"
huc12pp_info$`schema:name` <- paste("Outlet of",
huc12boundary$features$properties$name[match(rownames(huc12boundary_info),
rownames(huc12pp_info))])
huc12pp_info$`schema:description` <- "comment describing the outlet of each watershed"
huc12pp_info$`hyf:contributingCatchment` <- paste0(paste0("elfie/usgs/huc12/uswb/", huc12pp$features$properties$HUC_12))
huc12pp_info <- left_join(huc12pp_info, huc_nwis, by = c("jsonkey_HUC_12" = "huc12")) %>%
mutate(`hyf:nexusRealization` = paste0("elfie/usgs/nwissite/uswb/", nwis)) %>%
select(-nwis)
write.table(huc12pp_info, file = "usgs_huc12pp_uswb.tsv", sep = "\t", row.names = F)
### fline_info
preds <- c("jsonkey_huc12", "rdfs:type", "schema:name",
"schema:description", "schema:sameAs", "schema:image",
"hyf:realizedCatchment", "hyf:networkStation")
fline_info <- data.frame(matrix(nrow = length(hucs), ncol = length(preds)))
names(fline_info) <- preds
rownames(fline_info) <- nhdplusflowline$features$properties$huc12
fline_info$jsonkey_huc12 <- rownames(fline_info)
fline_info$`rdfs:type` <- "http://www.opengeospatial.org/standards/waterml2/hy_features/HY_HydrographicNetwork"
fline_info$`schema:name` <- paste("Hydro Network of",
huc12boundary$features$properties$name[match(rownames(huc12boundary_info),
rownames(fline_info))])
fline_info$`schema:description` <- "comment describing the network of each watershed"
fline_info$`hyf:realizedCatchment` <- paste0("elfie/usgs/huc12/uswb/", huc12boundary$features$properties$huc12)
fline_info <- left_join(fline_info, huc_nwis, by = c("jsonkey_huc12" = "huc12")) %>%
mutate(`hyf:networkStation` = paste0("https://waterdata.usgs.gov/nwis/inventory/?site_no=", nwis)) %>%
select(-nwis)
write.table(fline_info, file = "usgs_nhdplusflowline_uswb.tsv", sep = "\t", row.names = F)
### huc12
huc12 <- huc12boundary_info %>%
mutate(`schema:sameAs` = paste0("https://cida.usgs.gov/nwc/#!waterbudget/achuc/", jsonkey_huc12)) %>%
select(-`hyf:realizedCatchment`, -`schema:image`) %>%
mutate(`rdfs:type` = "http://www.opengeospatial.org/standards/waterml2/hy_features/HY_Catchment")
huc12 <- cbind(huc12,
list(`hyf:catchmentRealization` = paste0("elfie/usgs/huc12boundary/uswb/", hucs,
"_|_",
"elfie/usgs/nhdplusflowline/uswb/", hucs)),
list(`hyf:outflow` = paste0("elfie/usgs/huc12pp/uswb/", hucs)))
write.table(huc12, file = "usgs_huc12_uswb.tsv", sep = "\t", row.names = F)
### nwissite
preds <- c("jsonkey_site_no", "rdfs:type", "schema:name",
"schema:description", "schema:sameAs", "schema:image",
"hyf:HY_HydroLocationType", "hyf:realizedNexus")
nwissite<- data.frame(matrix(nrow = length(hucs), ncol = length(preds)))
names(nwissite) <- preds
rownames(nwissite) <- nwis_sites$features$properties$site_no
nwissite$jsonkey_site_no <- rownames(nwissite)
nwissite$`rdfs:type` <- "http://www.opengeospatial.org/standards/waterml2/hy_features/HY_HydroLocation_|_http://www.opengeospatial.org/standards/waterml2/hy_features/HY_HydrometricFeature_|_sosa:Sample"
nwissite$`schema:name` <- nwis_sites$features$properties$station_nm
nwissite$`schema:sameAs` <- paste0("https://waterdata.usgs.gov/nwis/inventory/?site_no=",
nwis_sites$features$properties$site_no)
nwissite$`schema:image` <- paste0("https://waterdata.usgs.gov/nwisweb/graph?agency_cd=USGS&site_no=",
nwis_sites$features$properties$site_no, "&parm_cd=00060&period=100")
nwissite$`hyf:HY_HydroLocationType` <- "hydrometricStation"
nwissite$`hyf:realizedNexus` <- paste0("elfie/usgs/huc12pp/uswb/", nwis_sites$features$properties$huc12)
nwissite$`sosa:isSampleOf` <- paste0("elfie/usgs/nhdplusflowline/uswb/", nwis_sites$features$properties$huc12)
nwissite$`sosa:isFeatureOfInterestOf` <- paste0("elfie/usgs/q/uswb/", nwis_sites$features$properties$huc12, "_|_",
"elfie/usgs/et/uswb/", nwis_sites$features$properties$huc12, "_|_",
"elfie/usgs/pr/uswb/", nwis_sites$features$properties$huc12)
write.table(nwissite, file = "usgs_nwissite_uswb.tsv", sep = "\t", row.names = F)
### q
q <- setNames(data.frame(matrix(nrow = length(hucs), ncol = 1)), "jsonkey_HUC_12")
rownames(q) <- huc12pp$features$properties$HUC_12
q$jsonkey_HUC_12 <- rownames(q)
q$`rdfs:type` <- "sosa:Observation"
q$`schema:name` <- paste("Flow observation for ",
huc12boundary$features$properties$name[match(rownames(huc12boundary_info),
rownames(q))])
q <- left_join(q, huc_nwis, by = c("jsonkey_HUC_12" = "huc12")) %>%
mutate(`sosa:hasResult@id` = paste0("https://waterservices.usgs.gov/nwis/dv/?format=waterml,2.0¶meterCd=00060&sites=", nwis),
`sosa:hasFeatureOfInterest` = paste0("elfie/usgs/nwissite/uswb/", nwis, "_|_", "elfie/usgs/huc12pp/uswb/", jsonkey_HUC_12)) %>%
select(-nwis)
q$`sosa:hasResult@type` = "wml2:MeasurementTimeseries"
write.table(q, file = "usgs_q_uswb.tsv", sep = "\t", row.names = F)
### et
et <- setNames(data.frame(matrix(nrow = length(hucs), ncol = 1)), "jsonkey_HUC_12")
rownames(et) <- huc12pp$features$properties$HUC_12
et$jsonkey_HUC_12 <- rownames(et)
et$`rdfs:type` <- "sosa:Observation"
et$`schema:name` <- paste("Evapotranspiration observation for ",
huc12boundary$features$properties$name[match(rownames(huc12boundary_info),
rownames(et))])
et$`sosa:hasResult@id` <- paste0("https://cida.usgs.gov/nwc/thredds/sos/watersmart/HUC12_data/HUC12_eta_agg.nc?",
"request=GetObservation&service=SOS&version=1.0.0&observedProperty=et&offering=",
et$jsonkey_HUC_12)
et$`sosa:hasResult@type` = "swe:DataArray"
et$`sosa:hasFeatureOfInterest` = paste0("elfie/usgs/huc12pp/uswb/", et$jsonkey_HUC_12)
write.table(et, file = "usgs_et_uswb.tsv", sep = "\t", row.names = F)
### pr
pr <- setNames(data.frame(matrix(nrow = length(hucs), ncol = 1)), "jsonkey_HUC_12")
rownames(pr) <- huc12pp$features$properties$HUC_12
pr$jsonkey_HUC_12 <- rownames(pr)
pr$`rdfs:type` <- "sosa:Observation"
pr$`schema:name` <- paste("Evapotranspiration observation for ",
huc12boundary$features$properties$name[match(rownames(huc12boundary_info),
rownames(pr))])
pr$`sosa:hasResult@id` <- paste0("https://cida.usgs.gov/nwc/thredds/sos/watersmart/HUC12_data/HUC12_daymet_agg.nc?",
"?request=GetObservation&service=SOS&version=1.0.0&observedProperty=prcp&offering=",
pr$jsonkey_HUC_12)
pr$`sosa:hasResult@type` = "swe:DataArray"
pr$`sosa:hasFeatureOfInterest` = paste0("elfie/usgs/huc12pp/uswb/", pr$jsonkey_HUC_12)
write.table(pr, file = "usgs_pr_uswb.tsv", sep = "\t", row.names = F)
|
b712c21b3183b2b9105f4a253a9d8ee3d7e7be53
|
b6b9ff2a41e582032c092b9f6809df798aff01ea
|
/plot2.R
|
6f519ca1f75cf152cfeca2b84531ce6a7b928ed0
|
[] |
no_license
|
geertpotters/ExData_Plotting1
|
a7a99605359a3b2c4c340fee5f091c6800ad82b2
|
bf1099d06af5ae2c2a3d6b184804f084e612c5d3
|
refs/heads/master
| 2021-01-18T08:07:56.866617
| 2014-07-13T19:38:44
| 2014-07-13T19:38:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 638
|
r
|
plot2.R
|
setwd("C:/R_exerc/explo")
Sys.setlocale("LC_TIME", "C")
power<-read.table("household_power_consumption.txt", sep=";", header=TRUE, na.strings="?")
power$Date<-paste(power$Date, power$Time, sep=" ")
power$Date<-strptime(power$Date, format="%d/%m/%Y %H:%M:%S")
i<-strptime("2007-02-01 00:00:01", format="%Y-%m-%d %H:%M:%S")
j<-strptime("2007-02-02 23:59:59", format="%Y-%m-%d %H:%M:%S")
power2<-subset(power, power$Date>i)
power3<-subset(power2, power2$Date<j)
png(file="plot2.png")
with(power3, plot(power3$Date,power3$Global_active_power,
type="l", main="", xlab="", ylab="Global active power (kilowatts)"))
dev.off()
|
74b451b22cf2b837ecdf7bfd97cd16383105f851
|
486d67c21caf7c40291d7c79de995bdc05bf8df0
|
/R/misc.R
|
666a26ce471fdc31b0eb1c6764bb1184822d8cdf
|
[
"Unlicense"
] |
permissive
|
jogrue/socmedhelpeRs
|
6b3d2994b1585c6908d0349f150f0c163ef5abd3
|
915412f135927107a3e16c3a1e4f5ab30cfe85c4
|
refs/heads/master
| 2022-04-22T18:44:42.721298
| 2020-04-17T15:01:23
| 2020-04-17T15:01:23
| 112,717,405
| 3
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 13,528
|
r
|
misc.R
|
#' Add variable scrape_time to old existing data
#'
#' In version 3.1 of this package a new variable "scrape_time" was added. It
#' records the Sys.time() when the data was scraped. This functions adds this
#' variable (with NA) to all files in an folder (if it does not exist already).
#'
#' @param dir A path to a directory containing data files generated with (older)
#' versions of this package.
#'
#' @export
add_scraped_time <- function(dir) {
# Checking parameters
if (missing(dir)){
stop("A directory with social media data has to be provided.")
}
if (!dir.exists(dir)) {
stop("Directory given for data does not exist.")
}
# Adjust directory path
if (!endsWith(dir, "/")) { dir <- paste0(dir, "/") }
# Read and check file names
files <- list.files(path = dir, pattern = "*.rds")
if (length(files) < 1) {
stop(paste0("There are no rds files in ", dir, "."))
}
# Add scraped_time variable if it does not already exist
for (i in files) {
file <- paste0(dir, i)
# If the file exists, it is loaded
if (file.exists(file)) {
data <- readRDS(file)
# If scrape_time (data from old versions) does not exist, add empty column
# Also save data set
if (!any(colnames(data) == "scrape_time")) {
data[, "scrape_time"] <- as.POSIXct(character(0))
saveRDS(data, file)
message(paste0("Added empty variable scrape_time for ", i, "!"))
}
}
}
}
#' Add variable fan_count to old existing data
#'
#' In version 3.2 of this package a new variable "fan_count" was added to
#' Facebook data. It records the fan count of pages when scraping posts. This
#' functions adds this variable (with NA) to all files in an folder (if it does
#' not exist already).
#'
#' @param dir A path to a directory containing data files generated with (older)
#' versions of this package.
#'
#' @export
add_fan_count <- function(dir) {
# Checking parameters
if (missing(dir)){
stop("A directory with social media data has to be provided.")
}
if (!dir.exists(dir)) {
stop("Directory given for data does not exist.")
}
# Adjust directory path
if (!endsWith(dir, "/")) { dir <- paste0(dir, "/") }
# Read and check file names
files <- list.files(path = dir, pattern = "*.rds")
if (length(files) < 1) {
stop(paste0("There are no rds files in ", dir, "."))
}
# Add fan_count variable if it does not already exist
for (i in files) {
file <- paste0(dir, i)
# If the file exists, it is loaded
if (file.exists(file)) {
data <- readRDS(file)
# If scrape_time (data from old versions) does not exist, add empty column
# Also save data set
if (!any(colnames(data) == "fan_count")) {
data[, "fan_count"] <- as.numeric(character(0))
saveRDS(data, file)
message(paste0("Added empty variable fan_count for ", i, "!"))
}
}
}
}
#' Add variables for reactions to old existing data
#'
#' If previous data was scraped without reactions, empty reaction variables are
#' added here if such variables to not exist already.
#'
#' @param dir A path to a directory containing data files generated with this
#' package.
#' @param sort Should variables be sorted according to current package default?
#' Defaults to TRUE.
#'
#' @export
add_reactions <- function(dir, sort = TRUE) {
# Checking parameters
if (missing(dir)){
stop("A directory with social media data has to be provided.")
}
if (!dir.exists(dir)) {
stop("Directory given for data does not exist.")
}
# Adjust directory path
if (!endsWith(dir, "/")) { dir <- paste0(dir, "/") }
# Read and check file names
files <- list.files(path = dir, pattern = "*.rds")
if (length(files) < 1) {
stop(paste0("There are no rds files in ", dir, "."))
}
# Add reaction variables if they do not already exist
for (i in files) {
file <- paste0(dir, i)
# If the file exists, it is loaded
if (file.exists(file)) {
data <- readRDS(file)
change_made <- FALSE
# If scrape_time (data from old versions) does not exist, add empty column
# Also save data set
if (!any(colnames(data) == "love_count")) {
data[, "love_count"] <- as.numeric(character(0))
change_made <- TRUE
}
if (!any(colnames(data) == "haha_count")) {
data[, "haha_count"] <- as.numeric(character(0))
change_made <- TRUE
}
if (!any(colnames(data) == "wow_count")) {
data[, "wow_count"] <- as.numeric(character(0))
change_made <- TRUE
}
if (!any(colnames(data) == "sad_count")) {
data[, "sad_count"] <- as.numeric(character(0))
change_made <- TRUE
}
if (!any(colnames(data) == "angry_count")) {
data[, "angry_count"] <- as.numeric(character(0))
change_made <- TRUE
}
if (change_made) {
if (sort) {
data <- sort_data(data = data)
}
saveRDS(data, file)
message(paste0("Added empty reaction variables for ", i, "!"))
}
}
}
}
#' Current order of variables in Facebook data
#'
#' @return The current list of variable names for sorting Facebook data.
#' @export
current_facebook_sort <- function() {
c(
"id",
"likes_count",
"from_id",
"from_name",
"message",
"created_time",
"type",
"link",
"story",
"comments_count",
"shares_count",
"love_count",
"haha_count",
"wow_count",
"sad_count",
"angry_count",
"scrape_time",
"fan_count"
)
}
#' Sort a dataset
#'
#' A social media dataset is ordered according to a list of variable names.
#' Unmentioned variables are attached at the end.
#'
#' @param data A data.frame generated with this package.
#' @param sorted_variables A list of variable names according to which the
#' dataset is sorted. Defaults to the package default for Facebook data.
#'
#' @return The sorted dataset.
#' @export
sort_data <- function(data, sorted_variables) {
# Checking parameters
if (missing(data)){
stop(paste0("A data.frame with social media data has to be provided."))
}
if (missing(sorted_variables)) {
sorted_variables <- current_facebook_sort()
}
dplyr::select(
data,
tidyselect::all_of(sorted_variables[sorted_variables %in% names(data)]),
dplyr::everything()
)
}
#' Sort data stored in a rds file
#'
#' A dataset stored in an rds file is ordered according to a list of variable
#' names. Unmentioned variables are attached at the end and the original file
#' is overwritten with the sorted dataset.
#'
#' @param file A path to an rds file generated with this package and containing
#' social media data.
#' @param sorted_variables A list of variable names according to which the
#' dataset is sorted. Defaults to the package default for Facebook data.
#'
#' @export
sort_file <- function(file, sorted_variables) {
# Checking parameters
if (missing(file)){
stop(paste0("A file path to social media data has to be provided."))
}
if (!file.exists(file)) {
stop("File path given for data does not exist.")
}
if (missing(sorted_variables)) {
sorted_variables <- current_facebook_sort()
}
data <- readRDS(file)
if (!identical(names(data), sorted_variables)) {
data <- sort_data(data, sorted_variables)
saveRDS(data, file)
message(paste0("Sorted dataset in ", file, "!"))
}
}
#' Sort all data files from a directory
#'
#' All datasets from one folder with rds files are ordered according to a list
#' of variable names. Unmentioned variables are attached at the end and the
#' original files are overwritten with the sorted datasets.
#'
#' @param dir A path to a directory containing data files generated with this
#' package.
#' @param sorted_variables A list of variable names according to which the
#' dataset is sorted. Defaults to the package default for Facebook data.
#'
#' @export
sort_dir <- function(dir, sorted_variables) {
# Checking parameters
if (missing(dir)){
stop(paste0("A directory containing social media data has to be provided."))
}
if (!dir.exists(dir)) {
stop("Directory given for data does not exist.")
}
if (missing(sorted_variables)) {
sorted_variables <- current_facebook_sort()
}
# Adjust directory path
if (!endsWith(dir, "/")) { dir <- paste0(dir, "/") }
# Read and check file names
files <- list.files(path = dir, pattern = "*.rds")
if (length(files) < 1) {
stop(paste0("There are no rds files in ", dir, "."))
}
# Sort all files
for (i in files) {
file <- paste0(dir, i)
# If the file exists, it is loaded
if (file.exists(file)) {
sort_file(file = file, sorted_variables = sorted_variables)
}
}
}
#' Clean Facebook data duplicates
#'
#' Somehow duplicates ended up in the data, where the same post is stored with
#' two different message IDs. Here, only messages where the sender (from_id),
#' message text (message), time of the posting (created_time), and message type
#' (type) are distinct are kept. You can provide either a directory or a file.
#'
#' @param dir A path to a directory containing Facebook data files.
#' @param file A file path to one Facebook data file (as rds file).
#' @param sort Data is sorted by these variable(s). Defaults to
#' c("created_time", "scrape_time", "id") to sort data by these variables.
#' The sort is applied before duplicates are removed. Therefore by default
#' newer data (by scrape_time) is kept.
#' @param sort_direction Sort parameters are applied in this directions. Should
#' be length 1 (all parameters are sorted this way) or the same length as
#' sort. Possible values are "desc" for descending and "asc" or "" for
#' ascending. Defaults to c("desc", "desc", "asc"). Thus, by default,
#' created_time is sorted descendingly, posts with the same created_time are
#' sorted descendingly by scrape_time and then ascendingly by message id.
#' @export
remove_facebook_duplicates <-
function(dir, file,
sort = c("created_time", "scrape_time", "id"),
sort_direction = c("desc", "desc", "asc")) {
# Checking parameters
if (missing(dir) & missing(file)){
stop("A directory or a file with social media data has to be provided.")
}
run_dir = (!missing(dir))
run_file = (!missing(file))
if (length(sort_direction) != length(sort) &
length(sort_direction) != 1) {
stop(paste0("Number of strings for sort_direction does not match ",
"the number of parameters in sort. Length of sort_direction ",
"should be 1 or the same length as sort."))
}
if (length(sort_direction) == 1) {
sort_direction <- rep(sort_direction[1], length(sort))
}
# Run for one file
if (run_file) {
if (!file.exists(file)) {
stop("Data file given does not exist.")
}
data <- readRDS(file)
if (
!all(
c("id","from_id", "message", "created_time", "type") %in%
names(data)
)
) {
stop(paste0("File ", file,
" does not include all Facebook data variables."))
}
for (j in length(sort):1) {
if (sort_direction[j] == "desc") {
data <- dplyr::arrange(
data,
dplyr::desc(dplyr::pull(data, sort[j]))
)
} else {
data <- dplyr::arrange(
data,
dplyr::pull(data, sort[j])
)
}
}
data <- dplyr::distinct(data, .data$id, .keep_all = TRUE)
data <- dplyr::distinct(
data,
.data$from_id,
.data$message,
.data$created_time,
.data$type,
.keep_all = TRUE)
saveRDS(data, file)
message(paste0("Removed duplicate entries from ", file, "!"))
}
# Run for the directory
if (run_dir) {
if (!dir.exists(dir)) {
stop("Directory given for data does not exist.")
}
# Adjust directory path
if (!endsWith(dir, "/")) { dir <- paste0(dir, "/") }
# Read and check file names
files <- list.files(path = dir, pattern = "*.rds")
if (length(files) < 1) {
stop(paste0("There are no rds files in ", dir, "."))
}
# Add scraped_time variable if it does not already exist
for (i in files) {
file <- paste0(dir, i)
# If the file exists, it is loaded
if (file.exists(file)) {
data <- readRDS(file)
if (
!all(
c("id","from_id", "message", "created_time", "type") %in%
names(data)
)
) {
stop(paste0("File ", i,
" does not include all Facebook data variables."))
}
for (j in length(sort):1) {
if (sort_direction[j] == "desc") {
data <- dplyr::arrange(
data,
dplyr::desc(dplyr::pull(data, sort[j]))
)
} else {
data <- dplyr::arrange(
data,
dplyr::pull(data, sort[j])
)
}
}
data <- dplyr::distinct(data, .data$id, .keep_all = TRUE)
data <- dplyr::distinct(
data,
.data$from_id,
.data$message,
.data$created_time,
.data$type,
.keep_all = TRUE)
saveRDS(data, file)
message(paste0("Removed duplicate entries from ", i, "!"))
}
}
}
}
|
8a305e844bcad3800fcc3d3aa96931541d37e963
|
c19a445f4845a2393b23343f7d518047c2484641
|
/analysis/profile_similarity/profile_similarity.r
|
7ffc2ad17d72f4899851b2fb3f7e25f0aaa8442e
|
[
"MIT"
] |
permissive
|
Kortemme-Lab/covariation
|
416ae8ec2b56681139a52abbafeaf178bed53e8d
|
e806290c96d08474e8043aff118f3568d526b2e7
|
refs/heads/master
| 2020-06-09T01:14:45.063784
| 2015-09-16T01:01:48
| 2015-09-16T01:01:48
| 30,557,754
| 4
| 2
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,455
|
r
|
profile_similarity.r
|
# The MIT License (MIT)
#
# Copyright (c) 2015 Noah Ollikainen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
pdf('profile_similarity.pdf',width=3.5,height=6)
par(mar=c(5, 5, 1, 1))
a<-read.table('profile_similarity.txt')
boxplot(a$V1,a$V2,ylab="Profile Similarity",col=c("#e74c3c","#3498db"),cex.lab=1.5,cex.axis=1.5,outline=F)
text(1:2, par("usr")[3] - 0.02, labels = c("Fixed\nBackbone","Flexible\nBackbone"), xpd = TRUE, cex=1.25)
dev.off()
|
6b006ed9e78f347886ac380b3291ebac1f4a4038
|
d7b529084879c844b6ed48a85da8fdfeaf120c39
|
/Galecki/data/BA99.R
|
25207fbd7e92e51c3d7e5ba42dd7e45eb741450c
|
[] |
no_license
|
DragonflyStats/LME-models
|
64042d75e3dd622b107b41aec12ff206dabdaabb
|
518773c2724986e6062987f85bb6844972054bff
|
refs/heads/master
| 2023-03-12T21:34:03.529043
| 2023-03-03T18:45:24
| 2023-03-03T18:45:24
| 20,188,457
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,583
|
r
|
BA99.R
|
#BA99.data
#Run the following code only once
BA99.data<- read.csv(file="BA99.csv",head=FALSE,sep=",")
#Run the following code only once - removes the unnecessary indices
BA99.data=BA99.data[,-1]
#510 Observations (85 subjects 2 methods 3 Replicates )
ob.js<-c(BA99.data[,1],BA99.data[,2],BA99.data[,3],
BA99.data[,7],BA99.data[,8],BA99.data[,9])
#using two methods
method<-c(rep("J",(3*85)),rep("S",(3*85)))
method=factor(method)
#85 subjects
seq2<-c(1:85)
subj=c(rep(seq2,6))
subj=factor(subj)
#3 replicates on each subject
repl<-method<-c(rep("1",85),rep("2",85),rep("3",85),
rep("1",85),rep("2",85),rep("3",85))
##############################################################
#using packages LME4 and NLME
library(lme4)
library(nlme)
###############################################################
lm(ob.js~method) #indicates bias
###############################################################
#Dataframe
BA99<-data.frame(ob.js, method,subj,repl)
################################################################
#Fits
fit1<-lme(ob.js ~ method, data =BA99, random = ~1|subj)
fit2<-lme(ob.js ~ method, data =BA99, random = ~1|subj/method)
fit3<-lme(ob.js ~ 1+ method, data =BA99, random = ~1|subj)
fit4<-lme(ob.js ~ 1+ method, data =BA99, random = ~ -1 + 1|subj )
fit5<-lme(ob.js ~ method, data =BA99, random = ~1|subj/repl/method)
fit6<-lme(ob.js ~ -1 - method, data =BA99, random = ~1|subj/repl/method)
##############################################################################
|
77569808f2bff0d89baddee542b14824bc1f1044
|
53532dd04543718ba2e983e7105cb422b0ce2c0e
|
/plot5.r
|
bf1e2a0dc8d0b3c91a2b351e459163d98845b524
|
[] |
no_license
|
ksjpswaroop/Exploratory_Prj2
|
fe3c86e3251b889a120fea18fcd6d496ea4b5cc9
|
b424380b21582edb1270c6c2c73e0857b3366ec7
|
refs/heads/master
| 2021-01-01T20:12:27.729081
| 2015-02-22T16:08:16
| 2015-02-22T16:08:16
| 31,168,706
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,713
|
r
|
plot5.r
|
#prj 2
#Read the data
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
png("plot5.png")
#Load Packages
library(dplyr)
#Greping require data from SCC datasets
motordata <-SCC[which(SCC$EI.Sector == "Mobile - On-Road Diesel Heavy Duty Vehicles" |
SCC$EI.Sector == "Mobile - On-Road Diesel Light Duty Vehicles" |
SCC$EI.Sector == "Mobile - On-Road Gasoline Heavy Duty Vehicles" |
SCC$EI.Sector == "Mobile - On-Road Gasoline Light Duty Vehicles"),]
#extract data of baltimore from NEI datasets
baltimore <- NEI[which(NEI$fips == "24510"),]
#matching dataframe
final <- merge(motordata,baltimore,by.x = "SCC",by.y = "SCC")
#final datasets with grouping and summarizing, in order to create plot
final.g <- ddply(final, .(year, EI.Sector), summarize, total.emissions = sum(Emissions) )
#Changing column names and replacing column value
colnames(final.g)[2] <- "Vehicles"
final.g$Vehicles <- mapvalues(final.g$Vehicles, from = c( "Mobile - On-Road Diesel Heavy Duty Vehicles",
"Mobile - On-Road Diesel Light Duty Vehicles",
"Mobile - On-Road Gasoline Heavy Duty Vehicles",
"Mobile - On-Road Gasoline Light Duty Vehicles"),
to = c("Heavy.Diesel","Light.Diesel","Heavy.Gasoline","Light.Gasoline"))
#loading graphics library
library(ggplot2)
#Plotting data on plot
ggploting <- ggplot(final.g, aes(year, total.emissions, color = Vehicles) )
ggploting <- ggploting + geom_line() +xlab("Year") + ylab("Total Emissions")
ggploting
dev.off()
#Done
|
5c9c286db08f8e79de61e11c656fa616230496b9
|
d9341c5d2a64632da7734447e86e7bba70577837
|
/SVM_AUDUSD/SVM_AUDUSD.R
|
49b5ce43c9e9fc474a21c446f7f8052b09672a0c
|
[
"MIT"
] |
permissive
|
tslaff/Machine_Learning_Projects
|
2e4be56c2e91db3b99bfbf70f6f03e2034b60cf6
|
3a219263d5d64a3b96d42ea2eec71b5872e94ebf
|
refs/heads/master
| 2021-01-21T13:03:45.472664
| 2016-05-05T16:32:42
| 2016-05-05T16:32:42
| 55,609,476
| 1
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,784
|
r
|
SVM_AUDUSD.R
|
# A great quantitative trading resource
install.packages('quantmod')
library(quantmod)
# The library containing our SVM
install.packages('e1071')
library(e1071)
# The plotting tools we will use
install.packages('ggplot2')
library(ggplot2)
# Allows us to grab the data from Dropbox
install.packages("repmis")
library(repmis)
# Grab the data directly from my dropbox account
filename <-"AUDUSD.csv"
mykey <- "kk47ydcz36xik2i"
Data<-source_DropboxData(filename,key=mykey, sep=",", header=TRUE)
#The 3-period relative strength index calculated off the open
RSI3<-RSI(Op(Data),n=3)
#Our measure of trend: the difference between the open price and the 50-period simple moving average
SMA50<-SMA(Op(Data),n=50)
Trend<-Op(Data)-SMA50
#The variable we are looking to predict; the direction of the next bar
Price<-Cl(Data)-Op(Data)
Class<-ifelse(Price>0,"UP","DOWN")
#Create the data set and removing the points where our indicators are still being calculated
DataSet<-data.frame(RSI3,Trend,Class)
DataSet<-na.omit(DataSet)
# Break int training, test and validation sets
Breakpoint_Test = (0.6)*nrow(DataSet)
Breakpoint_Val = (0.8)*nrow(DataSet)
Training<-DataSet[1:Breakpoint_Test,]
Test<-DataSet[(Breakpoint_Test+1):Breakpoint_Val,]
Validation<-DataSet[(Breakpoint_Val+1):nrow(DataSet),]
set.seed(1)
# Build our support vector machine using a radial basis function as our kernel, the cost, or C, at 1, and the gamma function at ½, or 1 over the number of inputs we are using
SVM<-svm(Class~RSI3+Trend,data=Training, kernel="radial",cost=1,gamma=1/2)
#Run the algorithm once more over the training set to visualize the patterns it found
TrainingPredictions<-predict(SVM,Training,type="class")
# Create a data set with the predictions
TrainingData<-data.frame(Training,TrainingPredictions)
# Let's visualize the patterns it was able to find
ggplot(TrainingData,aes(x=Trend,y=RSI3))+stat_density2d(geom="contour",aes(color=TrainingPredictions))+labs(title="SVM RSI3 and Trend Predictions",x="Open - SMA50",y="RSI3",color="Training Predictions")
# Now we'll build our long and short rules based on the patterns it found
ShortRange1<-which(Test$RSI3 < 25 & Test$Trend > -.010 & Test$Trend < -.005)
ShortRange2<-which(Test$RSI3 > 70 & Test$Trend < -.005)
ShortRange3<-which(Test$RSI3 > 75 & Test$Trend > .015)
LongRange1<-which(Test$RSI3 < 25 & Test$Trend < -.02)
LongRange2<-which(Test$RSI3 > 50 & Test$RSI3 < 75 & Test$Trend > .005 & Test$Trend < .01)
# Find our short trades
ShortTrades<-Test[c(ShortRange1,ShortRange2,ShortRange3),]
# And the short accuracy
ShortCorrect<-((length(which(ShortTrades[,3]=="DOWN")))/nrow(ShortTrades))*100
# Our long trades
LongTrades<-Test[c(LongRange1,LongRange2), ]
LongCorrect<-((length(which(LongTrades[,3]=="UP")))/nrow(LongTrades))*100
|
daa043b6a4b787774b286a06326c008d6a152ead
|
249eb3aee749043be46cb7898f4ee0316a76282a
|
/demos/2021-10-21.R
|
f2bf6e99affb106b41ecc78c9bb41cee0dde8226
|
[] |
no_license
|
rustky/cs499-599-fall-2021
|
338fc7b97431d0a25c2285ac0af4a3db664d8d84
|
3ea71159934c8c81da06d7c5d8a81e5c3b64cf36
|
refs/heads/main
| 2023-08-22T04:11:35.824001
| 2021-10-26T21:21:47
| 2021-10-26T21:21:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 3,653
|
r
|
2021-10-21.R
|
data(neuroblastoma, package="neuroblastoma")
library(data.table)
(nb.dt <- data.table(neuroblastoma$profiles))
(data.dt <- nb.dt[profile.id=="4" & chromosome=="2"])
library(ggplot2)
ggplot()+
geom_point(aes(
position, logratio),
data=data.dt)
data.dt[, data.i := 1:.N]
ggplot()+
geom_point(aes(
data.i, logratio),
data=data.dt)
hmm.spec <- depmixS4::depmix(
logratio ~ 1, data=data.dt, nstates=100)
model.or.null <- tryCatch({
depmixS4::fit(hmm.spec)
}, error=function(e){
NULL
})
if(!is.null(model.or.null)){
Do the homework
}
set.seed(1)
n.states <- 3
hmm.spec <- depmixS4::depmix(
logratio ~ 1, data=data.dt, nstates=n.states)
depmixS4::getpars(hmm.spec)
hmm.learned <- depmixS4::fit(hmm.spec)
(log.lik <- depmixS4::logLik(hmm.learned))
data.table(n.states, log.lik)
(learned.param.vec <- depmixS4::getpars(hmm.learned))
learned.param.list <- list()
param.type.vec <- c(mean="(Intercept)", sd="sd")
for(param.type in names(param.type.vec)){
param.name <- param.type.vec[[param.type]]
learned.param.list[[param.type]] <-
learned.param.vec[names(learned.param.vec)==param.name]
}
learned.param.list
data.table(hmm.learned@posterior)
data.dt[, best.state := factor(hmm.learned@posterior[,1]) ]
state.rle <- rle(as.integer(data.dt$best.state))
str(state.rle)
seg.dt <- data.table(
seg.size=state.rle$lengths,
cluster.i=state.rle$values)
seg.dt[, end := cumsum(seg.size)]
seg.dt[, start := c(1, end[-.N]+1)]
for(param.type in names(param.type.vec)){
param.name <- param.type.vec[[param.type]]
param.values <-
learned.param.vec[names(learned.param.vec)==param.name]
set(
seg.dt,
j=param.type,
value=param.values[seg.dt$cluster.i])
}
seg.dt
seg.dt[, state := factor(cluster.i)]
ggplot()+
geom_rect(aes(
xmin=start-0.5,
xmax=end+0.5,
ymin=mean-sd,
ymax=mean+sd,
fill=state),
alpha=0.5,
data=seg.dt)+
geom_vline(aes(
xintercept=start-0.5),
data=seg.dt[-1])+
geom_segment(aes(
start-0.5, mean,
xend=end+0.5, yend=mean,
color=state),
size=2,
data=seg.dt)+
geom_point(aes(
data.i, logratio, fill=best.state),
shape=21,
data=data.dt)
cpt.model <- suppressWarnings(changepoint::cpt.meanvar(
data.dt$logratio,
method="SegNeigh", penalty="Manual", Q=nrow(seg.dt)))
cpt.model@param.est
(cpt.segs <- data.table(
end=cpt.model@cpts))
cpt.segs[, start := c(1, end[-.N]+1)]
cpt.segs
cpt.model@param.est$sd <-
sqrt(cpt.model@param.est$variance)
for(param.type in names(cpt.model@param.est)){
param.values <- cpt.model@param.est[[param.type]]
set(
cpt.segs,
j=param.type,
value=param.values)
}
ggplot()+
geom_rect(aes(
xmin=start-0.5,
xmax=end+0.5,
ymin=mean-sd,
ymax=mean+sd),
alpha=0.5,
data=cpt.segs)+
geom_vline(aes(
xintercept=start-0.5),
data=cpt.segs[-1])+
geom_segment(aes(
start-0.5, mean,
xend=end+0.5, yend=mean),
size=2,
data=cpt.segs)+
geom_point(aes(
data.i, logratio),
shape=21,
data=data.dt)+
geom_rect(aes(
xmin=start-0.5,
xmax=end+0.5,
ymin=mean-sd,
ymax=mean+sd,
fill=state),
alpha=0.5,
data=seg.dt)+
geom_vline(aes(
xintercept=start-0.5),
data=seg.dt[-1])+
geom_segment(aes(
start-0.5, mean,
xend=end+0.5, yend=mean,
color=state),
size=2,
data=seg.dt)
data.dt[, mean_HMM := TODO]
data.dt[, sd_HMM := TODO]
data.dt[, mean_cpt := TODO]
data.dt[, sd_cpt := TODO]
for(model.name in c("cpt", "HMM")){
mean.vec <- data.dt[[paste0("mean_", model.name)]]
sd.vec <- TODO
neg.log.lik <- -sum(dnorm(
data.dt$logratio, mean.vec, sd.vec, log=TRUE))
}
|
a0f711e893a07caed684fbba5514003b67a22abe
|
25a91db17d1cd93484f1529bb0e642d711e16ffc
|
/2020-1_1st_package.R
|
f91601aa53b5f05391a2b14d42b3d42c11fa3438
|
[] |
no_license
|
syppp/Psat_2020_package
|
5c4674c115e1bd47c0420ba7b47ffc56c049856b
|
5dfb4f17a4c0e91e294d280d96b5886d14780c7b
|
refs/heads/master
| 2023-04-17T19:50:45.715266
| 2021-04-27T07:30:56
| 2021-04-27T07:30:56
| 361,985,040
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,533
|
r
|
2020-1_1st_package.R
|
library(data.table)
library(plyr)
library(magrittr)
library(dplyr)
library(tidyverse)
library(stringr)
library(lubridate)
library(ggplot2)
data <- fread("C:/Users/user1/Desktop/???б?/3?г? 2?б?/?Ǽ?/??Ű??/1???? ??Ű??/??????0.csv", stringsAsFactors=FALSE,data.table=FALSE)
data %<>% select(-Petal.Length) %>% filter(data$Petal.Width<=1.800)
data %<>% mutate(Sepal_mean= mean(data$Sepal.Length)) %>% mutate(Sepal_sd= sqrt(var(data$Sepal.Length)))
data %<>% group_by(Species) %>% mutate(Sepal.Width_mean_each=mean(Sepal.Width))
data %<>% group_by(Species) %>% mutate(Sepal.num=n())
data %<>% ungroup()
data <- arrange(data,desc(Sepal.Length))
data$Species %<>% revalue(c("virginica"="VI","versicolor" = "VE","setosa" = "SE"))
data %<>% rename("name"="Species")
#Ch.1
data2<- fread("C:/Users/user1/Desktop/???б?/3?г? 2?б?/?Ǽ?/??Ű??/1???? ??Ű??/??????1.csv", stringsAsFactors=FALSE,data.table=FALSE)
str(data2)
summarise(data2)
col <- length(data2)
for(i in 0:col){
print(length(unique(data2[,i])) )}
data2<- select(data2,click,placement_type,event_datetime,age,gender,install_pack,marry,predicted_house_price)
data2$age<-as.factor(data2$age)
data2$weekend <- ifelse(wday(data2$event_datetime)==1|wday(data2$event_datetime)==6 , "yes","no")
data2$day <- factor(wday(data2$event_datetime))
data2$time <- factor(hour(data2$event_datetime))
data2$date <- factor(mday(data2$event_datetime))
data2 %<>% group_by(date,time) %>% mutate(click_mean=mean(click))
data2$number_install<- str_count(data2$install_pack,",")
data2[sapply(data2, is.character)] %<>% lapply(as.factor)
#Ch.2
ggplot(data2,aes(time,click_mean,group=date))+geom_line(aes(color=date))+theme_bw()
ggplot(data2,aes(time,click_mean,group=date))+geom_line(aes(color=date))+facet_wrap(~ date,ncol=4)+theme_bw()
ggplot(data=data2) + geom_bar(mapping = aes(x=age, fill=placement_type),position="fill")
data2 %<>% group_by(age,placement_type) %>% mutate(num = n())
ggplot(data2,aes(x=age,y=placement_type,size=num))+geom_point(shape=21, colour="black",fill="skyblue")+scale_size_area(max_size=15)+theme(panel.background = element_blank())
data1<- data2 %>% gather(key,value,number_install,predicted_house_price,click_mean)
ggplot(data1, aes(sample=value,shape=weekend, colour=weekend))+stat_qq()+facet_wrap(.~key, scales="free_y")
ggplot(data1, aes(x=weekend, y=value)) + geom_violin(aes(fill=weekend)) + geom_boxplot(width=0.3) + stat_summary(fun.y = "mean", geom = "point", shape = 5) + facet_wrap(.~key, scales = "free_y")
|
2bc729ebd4a601bde507946528354948b2e22cec
|
ce16ab16f539400008d7290c3b20438014e15cc4
|
/man/fix_MSMS.Rd
|
d5fd01e9197af7387a69c1d90d9a94ec2806f58f
|
[
"MIT"
] |
permissive
|
antonvsdata/notame
|
5c7f61a7aa1f37cbc0e162c048d0cae3a9fa7cb9
|
6afdf6f0f23a3d172edcd60c28c23be0be59626e
|
refs/heads/main
| 2023-08-17T05:57:38.037628
| 2023-04-02T10:12:36
| 2023-04-02T10:12:36
| 231,045,948
| 11
| 3
|
MIT
| 2023-01-21T12:41:25
| 2019-12-31T07:19:31
|
R
|
UTF-8
|
R
| false
| true
| 1,452
|
rd
|
fix_MSMS.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/transformations.R
\name{fix_MSMS}
\alias{fix_MSMS}
\title{Transform the MS/MS output to publication ready}
\usage{
fix_MSMS(
object,
ms_ms_spectrum_col = "MS.MS.spectrum",
peak_num = 10,
min_abund = 5,
deci_num = 3
)
}
\arguments{
\item{object}{a MetaboSet object}
\item{peak_num}{maximum number of peak that is kept (Recommended: 4-10)}
\item{min_abund}{minimum relative abundance to be kept (Recommended: 1-5)}
\item{deci_num}{maximum number of decimals to m/z value (Recommended: >2)}
}
\value{
MetaboSet object as the one supplied, with publication-ready MS/MS peak information
}
\description{
Change the MS/MS output from MS-DIAL format to publication-ready format.
Original spectra is sorted according to abundance percentage and clarified. See the example below.
}
\details{
Original MS/MS spectra from MS-DIAL:
m/z:Raw Abundance
23.193:254 26.13899:5 27.50986:25 55.01603:82 70.1914:16 73.03017:941 73.07685:13 73.13951:120
Spectra after transformation:
m/z (Abundance)
73.03 (100), 23.193 (27), 73.14 (12.8), 55.016 (8.7)
}
\examples{
# Spectra before fixing
fData(merged_sample)$MS.MS.spectrum[!is.na(fData(merged_sample)$MS.MS.spectrum)]
# Fixing spectra with default settings
fixed_MSMS_peaks <- fix_MSMS(merged_sample)
# Spectra after fixing
fData(fixed_MSMS_peaks)$MS_MS_Spectrum_clean[!is.na(fData(fixed_MSMS_peaks)$MS_MS_Spectrum_clean)]
}
|
53b1203ddc1a4216b77a9fbbd4af46eeb212b104
|
a47ce30f5112b01d5ab3e790a1b51c910f3cf1c3
|
/B_analysts_sources_github/jcheng5/shiny-partials/ui.R
|
6b0640bbc137d818f25c9071f1ac0512a7fed97d
|
[] |
no_license
|
Irbis3/crantasticScrapper
|
6b6d7596344115343cfd934d3902b85fbfdd7295
|
7ec91721565ae7c9e2d0e098598ed86e29375567
|
refs/heads/master
| 2020-03-09T04:03:51.955742
| 2018-04-16T09:41:39
| 2018-04-16T09:41:39
| 128,578,890
| 5
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 448
|
r
|
ui.R
|
fluidPage(
h2("Demonstration of partials"),
# We're not putting anything in this tabsetPanel's tabs; we're just
# rendering the tabs themselves, and using the selected value to tell
# us which partial to render in the uiOutput("container") below
tabsetPanel(id = "partial", type = "pill",
tabPanel("Load", value="load"),
tabPanel("Manipulate", value="manipulate"),
tabPanel("Plot", value="plot")
),
uiOutput("container")
)
|
6543eca3f12ff54a73874cc1d5a888f5a00c2a95
|
014fb48ad4153b3e254db17dfcc695d3dbb324a5
|
/run_analysis.R
|
aba98753c8e1ae363f9d7e37b1e356ba067564d4
|
[] |
no_license
|
gianfilippo/GCDcp
|
61668b2dac72ffae46c6f4d3d9c83c0657afeb49
|
779458ec12c994e0cb381cfaaea5eed18fc6a6a3
|
refs/heads/master
| 2016-09-08T01:27:35.462999
| 2015-01-26T03:55:53
| 2015-01-26T03:55:53
| 29,787,480
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 6,306
|
r
|
run_analysis.R
|
rm(list=ls())
library(data.table)
library(dplyr)
# defines source data dir
datasetDIR <- "D:/Data/UCI HAR Dataset"
# defines source test and train dirs
testsetDIR <- "test"
trainsetDIR <- "train"
# defines target merged dir and creates it if it does not exists yet
mergedsetDIR <- "merged"
if (!file.exists(paste(datasetDIR,mergedsetDIR,sep="/"))) dir.create(paste(datasetDIR,mergedsetDIR,sep="/"))
# Reads subject files from test and target dirs and output a merged subject file
print("Reading subject_test file")
fileID <- "subject_test.txt"
filTE <- scan(paste(datasetDIR,testsetDIR,fileID,sep="/"),numeric())
print("Reading subject_train file")
fileID <- "subject_train.txt"
filTR <- scan(paste(datasetDIR,trainsetDIR,fileID,sep="/"),numeric())
print("Writing merged subject file")
fileID <- "subject_merged.txt"
write.table(rbind(t(filTE),t(filTR)),file=paste(datasetDIR,mergedsetDIR,fileID,sep="/"),quote=F,col.names=F,row.names=F,sep="\t")
# Reads x files from test and target dirs and output a merged X file
fileID <- "X_test.txt"
# reads one line to find the number of columns
fil <- scan(paste(datasetDIR,testsetDIR,fileID,sep="/"),numeric(),nlines=1)
Ncols <- length(fil)
filTE <- scan(paste(datasetDIR,testsetDIR,fileID,sep="/"),rep(numeric(),length(fil)))
filTE <- t(matrix(filTE,Ncols,length(filTE)/Ncols))
fileID <- "X_train.txt"
# reads one line to find the number of columns
fil <- scan(paste(datasetDIR,trainsetDIR,fileID,sep="/"),numeric(),nlines=1)
Ncols <- length(fil)
filTR <- scan(paste(datasetDIR,trainsetDIR,fileID,sep="/"),rep(numeric(),length(fil)))
filTR <- t(matrix(filTR,Ncols,length(filTR)/Ncols))
print("Writing merged X file")
fileID <- "X_merged.txt"
write.table(rbind(filTE,filTR),file=paste(datasetDIR,mergedsetDIR,fileID,sep="/"),quote=F,col.names=F,row.names=F,sep="\t")
# Reads y files from test and target dirs and output a merged y file
print("Reading y_test file")
fileID <- "y_test.txt"
filTE <- scan(paste(datasetDIR,testsetDIR,fileID,sep="/"),numeric())
print("Reading y_train file")
fileID <- "y_train.txt"
filTR <- scan(paste(datasetDIR,trainsetDIR,fileID,sep="/"),numeric())
print("Writing merged y file")
fileID <- "y_merged.txt"
write.table(rbind(t(filTE),t(filTR)),file=paste(datasetDIR,mergedsetDIR,fileID,sep="/"),quote=F,col.names=F,row.names=F,sep="\t")
# clear main variables
rm(fil,filTR,filTE)
# defines target Inertial Signals dir and creates it if it does not exists yet
if (!file.exists(paste(datasetDIR,mergedsetDIR,"Inertial Signals",sep="/"))) dir.create(paste(datasetDIR,mergedsetDIR,"Inertial Signals",sep="/"))
print("Merging files from test and train <Inertial Signals> directories")
# identify all files under test and train 'Inertial Signals' dirs
testfilesIS <- list.files(paste(datasetDIR,testsetDIR,"Inertial Signals",sep="/"),"txt")
trainfilesIS <- list.files(paste(datasetDIR,trainsetDIR,"Inertial Signals",sep="/"),"txt")
# loops through each matching file pairs under test and train Inertial Signals dir
# reas the maching pairs of files and output the scorresponding merged file under
# the merged Inertial Signals dir
for (find in 1:length(testfilesIS)) {
print(paste("Reading file",find,"of",length(testfilesIS),"from testset"))
fileID <- testfilesIS[find]
# reads one line to find the number of columns
fil <- scan(paste(datasetDIR,testsetDIR,"Inertial Signals",fileID,sep="/"),numeric(),nlines=1)
Ncols <- length(fil)
filTE <- scan(paste(datasetDIR,testsetDIR,"Inertial Signals",fileID,sep="/"),rep(numeric(),length(fil)))
filTE <- t(matrix(filTE,Ncols,length(filTE)/Ncols))
print(paste("Test file dim",paste(dim(filTE),collapse="x")))
print(paste("Reading file",find,"of",length(testfilesIS),"from trainset"))
fileID <- trainfilesIS[find]
# reads one line to find the number of columns
fil <- scan(paste(datasetDIR,trainsetDIR,"Inertial Signals",fileID,sep="/"),numeric(),nlines=1)
Ncols <- length(fil)
filTR <- scan(paste(datasetDIR,trainsetDIR,"Inertial Signals",fileID,sep="/"),rep(numeric(),length(fil)))
filTR <- t(matrix(filTR,Ncols,length(filTR)/Ncols))
print(paste("Train file dim",paste(dim(filTR),collapse="x")))
print(paste("Writing merged file",find,"of",length(testfilesIS)))
fileID <- paste(strsplit(fileID,"_train",fixed=T)[[1]][1],"all.txt",sep="_")
print(paste("Merged file dim",paste(dim(rbind(filTE,filTR)),collapse="x")))
write.table(rbind(filTE,filTR),file=paste(datasetDIR,mergedsetDIR,"Inertial Signals",fileID,sep="/"),quote=F,col.names=F,row.names=F,sep="\t")
}
# clear main variables
rm(filTE,filTR,fil,Ncols,testfiles,testfilesIS,testsetDIR,trainfiles,trainfilesIS,trainsetDIR)
# loads the activity labels file
print("Loading Activity Labels file")
fileID <- "activity_labels.txt"
filAL <- read.table(paste(datasetDIR,fileID,sep="/"),header=F,sep=" ",stringsAsFactors=F)[,2]
# loads the features file
print("Loading Features file")
fileID <- "features.txt"
filFEAT <- read.table(paste(datasetDIR,fileID,sep="/"),header=F,sep=" ",stringsAsFactors=F)[,2]
# identify the column indices of the estimates of the mean and standard deviations
indmean <- grep("mean",filFEAT)
indstd <- grep("std",filFEAT)
# load the merged subject, X and y files into a data table
fil <- fread(paste(datasetDIR,mergedsetDIR,"subject_merged.txt",sep="/"),stringsAsFactors=F,header=F)
fil <- cbind(fil,fread(paste(datasetDIR,mergedsetDIR,"y_merged.txt",sep="/"),stringsAsFactors=F,header=F))
fil <- cbind(fil,fread(paste(datasetDIR,mergedsetDIR,"X_merged.txt",sep="/"),stringsAsFactors=F,header=F))
# label data set columns with descriptive variables
setnames(fil,c("subjects","activity",eval(filFEAT)))
# extract subset of mean and standard deviation estimates
#fil <- fil[,sort(c(1,2,indmean+2,indstd+2)),with=F]
fil <- subset(fil,select=sort(c(1,2,indmean+2,indstd+2)))
# replaces activity codes with activity names
fil[["activity"]] <- filAL[fil[["activity"]]]
# create a data tabke tbl
fil <- tbl_dt(fil)
# group datga tagle tbl by subject and activity
fil <- group_by(fil,subjects,activity)
# estimate the average for each subject and each activity
fil_final <- summarise_each(fil,funs(mean))
# output fil_final to tab delimited text file '' under working dir
write.table(fil_final,file='final_tidy_dataset.txt',row.names=F,quotes=F,sep="\t")
|
0304d02c57d4be8456c7b807ba890572f9851732
|
ddd8bec8fc0990fe1d4a9d3788d33a4de4a5c5e5
|
/splashR/man/getSplash.Rd
|
816ec4e594c930362abf19447bb3b43a3f0e55c3
|
[
"BSD-3-Clause"
] |
permissive
|
berlinguyinca/spectra-hash
|
7219a24f2f4f5ae564d43b3ff73186037a56c951
|
174fbf289a0357535f9bacda282b9a2dbb7807cc
|
refs/heads/master
| 2022-05-08T14:01:14.238185
| 2022-03-31T21:56:14
| 2022-03-31T21:56:14
| 38,338,132
| 27
| 15
|
BSD-3-Clause
| 2022-03-31T21:56:15
| 2015-06-30T23:20:50
|
C++
|
UTF-8
|
R
| false
| false
| 469
|
rd
|
getSplash.Rd
|
\name{getSplash}
\alias{getSplash}
\title{
Calculates the SPLASH of a spectrum
}
\description{
Starting from an input matrix with peaks, it calculates the SPLASH of the
spectrum.
}
\usage{
getSplash(peaks)
}
\arguments{
\item{peaks}{a matrix of two columns, "mz" and "intensity".}
}
\value{
the SPLASH of the spectrum.
}
\examples{
caffeine <- cbind(
mz=c(138.0641, 195.0815),
intensity=c(71.59, 261.7)
)
splash <- getSplash(caffeine)
}
\author{
Steffen Neumann
}
|
7b79eca3feb657fd0ba2eb7201692693a71e647c
|
bbeb67ddaffed17e871db9a6a5d6b63dafe58ce4
|
/poz100r/inst/scripts/mize.R
|
db6baf834066e625418603b3fabcea485c9f27bf
|
[
"BSD-2-Clause"
] |
permissive
|
bdilday/poz100analytics
|
25e79e09630e4b3c907ae3e47d4e074d6c9c2f02
|
d53a18b2bf0102e57af396989444521c8187a904
|
refs/heads/master
| 2021-06-21T05:00:15.107386
| 2019-07-22T00:35:31
| 2019-07-22T00:35:31
| 20,086,147
| 0
| 0
|
BSD-2-Clause
| 2019-07-22T00:35:32
| 2014-05-23T03:54:11
|
R
|
UTF-8
|
R
| false
| false
| 2,538
|
r
|
mize.R
|
library(dplyr)
library(ggplot2)
library(ggrepel)
pl_lkup = Lahman::Master %>% dplyr::select(playerID, retroID, bbrefID, nameFirst, nameLast)
pl_lkup$nameAbbv = paste(stringr::str_sub(pl_lkup$nameFirst, 1, 1), pl_lkup$nameLast, sep='.')
b = Lahman::battingStats()
plot1 = function(b) {
b = b %>% filter(yearID >= 1901)
lab_df = b %>%
filter(HR>=5, AB>=250) %>%
mutate(so_=SO/AB, hr_=HR/AB, z=(HR-SO)/AB) %>%
filter( ((HR-SO)/AB >= 1000) |
((HR/AB >= 0.08) & (z >=-0.02)) |
( (HR/AB>=0.037) & (z >= 0.01))
) %>%
merge(pl_lkup, by.x='playerID', by.y='playerID') %>% mutate(k=sprintf("%s %d", nameAbbv, yearID))
lab_df = lab_df %>% mutate(ismize=ifelse(playerID == 'mizejo01', T, F))
p = b %>% filter(HR>=5, AB>=250) %>%
mutate(so_=SO/AB, hr_=HR/AB, z=(HR-SO)/AB) %>%
ggplot(aes(x=hr_, y=z)) +
geom_point(alpha=0.25, size=0.25) +
stat_density2d(color='steelblue') +
geom_hline(yintercept = 0) +
geom_point(data=lab_df) +
geom_text_repel(data=lab_df, aes(label=k, color=ismize), size=2.5) +
scale_color_manual(values = c("gray24", 'red')) + guides(color='none')
p = p + theme_minimal(base_size = 16) +
labs(title='HR vs SO rates - Season', x= 'HR / AB', y = ' (HR - SO) / AB')
p + coord_cartesian(ylim=c(-0.2, 0.05), xlim=c(0, 0.15))
# p + coord_cartesian(ylim=c(-0.3, 0.05), xlim=c(0, 0.15))
}
plot2 = function(b) {
b2 = b %>% filter(yearID>=1901) %>% group_by(playerID) %>% summarise(HR=sum(HR), AB=sum(AB), SO=sum(SO))
lab_df = b2 %>%
filter(HR>=5, AB>=250) %>%
mutate(so_=SO/AB, hr_=HR/AB, z=(HR-SO)/AB) %>%
filter( ((HR-SO)/AB >= 1000) |
((HR/AB >= 0.05) & (z >=-0.08)) |
( (HR/AB>=0.025) & (z >= -0.02))
) %>%
merge(pl_lkup, by.x='playerID', by.y='playerID') %>% mutate(k=sprintf("%s", nameAbbv))
lab_df = lab_df %>% mutate(ismize=ifelse(playerID == 'mizejo01', T, F))
p = b2 %>% filter(HR>=5, AB>=250) %>%
mutate(so_=SO/AB, hr_=HR/AB, z=(HR-SO)/AB) %>%
ggplot(aes(x=hr_, y=z)) +
geom_point(alpha=0.25, size=0.25) +
stat_density2d(color='steelblue') +
geom_hline(yintercept = 0) +
geom_point(data=lab_df) +
geom_text_repel(data=lab_df, aes(label=k, color=ismize), size=2.5) +
scale_color_manual(values = c("gray24", 'red')) + guides(color='none')
p = p + theme_minimal(base_size = 16) +
labs(title='HR vs SO rates - Career', x= 'HR / AB', y = ' (HR - SO) / AB')
p + coord_cartesian(ylim=c(-0.3, 0.015), xlim=c(0, 0.1))
}
|
1169cdcf4bdb5bcb6be602e05917408bec6f664a
|
2e8ef69f00c7f5c6ebf8b0548e6ba7b689905978
|
/man/eq_location_clean.Rd
|
b9a3063f6dec737bb4b53ad5c2cfa50b444fea7d
|
[] |
no_license
|
azerbinati/capStoneQuake
|
1092c7870258b9164641c7e25d770e271939dcd1
|
c8a1b440dcbf5262508aa210e6560ad44fc7a9a0
|
refs/heads/master
| 2021-01-01T18:21:21.137116
| 2017-07-27T17:52:00
| 2017-07-27T17:52:00
| 98,320,659
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| true
| 586
|
rd
|
eq_location_clean.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/main.R
\name{eq_location_clean}
\alias{eq_location_clean}
\title{eq_location_clean}
\usage{
eq_location_clean(rawNOAA)
}
\arguments{
\item{rawNOAA}{}
}
\value{
the original data.frame with LOCATION_NAME mutated
}
\description{
this function take in the NOAA data.frame and process the column LOCATION_NAME.
The column will get the first country removed and convert the rest to mixed case. IE, the value "ITALY: SICILY" will
be converted in "Sicily".
}
\examples{
\dontrun{
eq_location_clean(rawNOAA)
}
}
|
e65b77a8a414d48d7dc5456cd26aec0fc0f404aa
|
d20145e080798319e0028a4c9d8851f619285c29
|
/ch06/R/ca-linreg.R
|
506b9a8e3cc955dffb06892fe67e7e34b851e88b
|
[] |
no_license
|
friendly/VCDR
|
da441b8306969fd6469a3bbc6a4475e028c61e29
|
818156ee0a26943a656ae915d924773c87654cec
|
refs/heads/master
| 2023-02-18T08:40:28.634897
| 2014-12-05T13:24:55
| 2014-12-05T13:24:55
| 16,708,002
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,733
|
r
|
ca-linreg.R
|
# linear regressions of CA
haireye <- margin.table(HairEyeColor, 1:2)
library(ca)
(haireye.ca <- ca(haireye))
rowc <- haireye.ca$rowcoord[,1:2] # hair colors
colc <- haireye.ca$colcoord[,1:2] # eye colors
y1 <- rep(rowc[,1], 4)
y2 <- rep(rowc[,2], 4)
x1 <- rep(colc[,1], each=4)
x2 <- rep(colc[,2], each=4)
df <- data.frame(haireye, x1, x2, y1, y2)
# order alphabetically
df$hair <- rep(order(levels(df$Hair)), 4)
df$eye <- rep(order(levels(df$Eye)), each=4)
library(vcdExtra)
dft <- expand.dft(df) # weight by Freq
# correlations of CA scored categories
cor(dft[,c("x1","x2")], dft[,c("y1", "y2")])
zapsmall(cor(dft[,c("x1","x2")], dft[,c("y1", "y2")]))
#plot(y1 ~ x1, df)
#text(df$x1, df$y1, df$Freq, adj=c(0,1))
modY <- lm(y1 ~ x1, data=dft)
modX <- lm(x1 ~ y1, data=dft)
# Reproduce fig 5.6 in vcd
### this is not correct yet ###
with(df, {
symbols(x1, y1, circles=sqrt(Freq/800), inches=FALSE,
ylim=c(-2,2), xlim=c(-1.5, 1.5),
xlab="X1 (Eye color)", ylab="Y1 (Hair color)")
text(x1, y1, Freq)
abline(modY, col="red")
abline(modX, col="blue")
text(0, y1[1:4], df$Hair[1:4], col="red")
text(x1[4*1:4], -2, df$Eye[4*(1:4)], col="blue")
}
)
# Reproduce fig 5.5 in vcd
### this is not correct yet ###
ymeans <- aggregate(hair ~ eye, data=dft, FUN=mean)
xmeans <- aggregate(eye ~ hair, data=dft, FUN=mean)
H <- order(levels(df$Hair))
E <- order(levels(df$Eye))
with(df, {
plot(eye, hair, cex=sqrt(Freq/10),
xlim=c(0,4), ylim=c(0,4))
lines(ymeans[,2:1], col="red", lwd=2, type="b", cex=1.5, pch=16)
lines(xmeans, col="blue", lwd=2, type="b", cex=1.5, pch=16)
text(0, 1:4, df$Hair[H], col="red")
text(1:4, 0, df$Eye[4*E], col="blue")
text(eye, hair, Freq, adj=c(0,1))
})
|
aabc8c3d8a819070e5e5e52945f003b156413f11
|
37e81f35c3fb22160f4e7d7bf8c27d99569ad6af
|
/dynoNEM/simulationsdynoNEMs.R
|
c933afe22c49ab467807461ff1665b6080900a0e
|
[] |
no_license
|
paurushp/dynonem
|
5e87ec1426e7728ff548fdc9a8b9bc38da22e084
|
c45dbe300b791406f8e22348484a2c65cd1d62ac
|
refs/heads/master
| 2020-04-15T12:12:32.060526
| 2019-01-08T14:24:21
| 2019-01-08T14:24:21
| 164,664,784
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 14,902
|
r
|
simulationsdynoNEMs.R
|
library(RBGL)
library(Hmisc)
library(multicore)
library(nem)
source("~/workingAt/trunk/dynoNEM/dynoNEM.R")
## retrieve graphs of KEGG signaling pathways
KEGG.graphs = function(){
require(KEGGgraph)
require(RCurl)
require(gene2pathway)
kegg_hierarchy = gene2pathway:::getKEGGHierarchy()
signaltrans = kegg_hierarchy$pathIDsLev2[grep("Signal Transduction", names(kegg_hierarchy$pathIDsLev2))]
pathways = names(which(sapply(kegg_hierarchy$parentPaths, function(p) signaltrans %in% unlist(p))))
pathways = paste("hsa", pathways, ".xml", sep="")
baseurl = "ftp://ftp.genome.jp/pub/kegg/xml/kgml/non-metabolic/organisms/hsa/"
ftp = getURL(baseurl)
ftp = unlist(strsplit(ftp,"\n"))
ftp = ftp[grep("hsa[0-9][0-9][0-9][0-9][0-9]\\.xml", ftp)]
urls = sapply(ftp, function(ft) paste(baseurl, substr(ft, nchar(ft)-11,nchar(ft)), sep=""))
idx = unlist(sapply(pathways, function(p) grep(p, urls)))
graphs = sapply(urls[idx], function(u) parseKGML2Graph(u))
nacc = sapply(graphs, function(mygraph) sapply(acc(mygraph, nodes(mygraph)), length))
save(graphs, nacc, file="~/workingAt/trunk/dynoNEM/KEGGgraphs.rda")
}
## DNEM model by Anchang et al. - very slow
#DNEM = function(D, initial=NULL, priorNet=NULL, priorE=NULL){
# T = dim(D)[1]
# control = set.default.parameters(unique(colnames(D[T,,])), para=c(0.1, 0.1))
# if(!is.null(priorNet)){
# control$Pm = priorNet
# net = nemModelSelection(c(0.01, 0.01, 0.1, 1, 100, 100), D[T,,],inference="triples", control=control)
# }
# else
# net = nem(D[T,,],inference="triples", control=control)
# G = as(net$graph, "matrix")
# D0<-array(0,dim=dim(D))
# colnames(D0)<-colnames(D)
# rownames(D0)<-rownames(D)
# Data1<-abind(D0[1,,],D,along=1)
# theta.init = sapply(as.character(1:dim(D)[2]), function(i) sapply(net$mappos, function(g) i %in% g))
# theta.init = apply(theta.init, 2, which.max)
# lags.init=sample(0:T, dim(D)[2], replace=TRUE)
# Data1 = aperm(Data1, c(2,3,1))
# res = dnem(3, Data1, 10000, G, theta.init.lags.init, 0.1, 0.1, 0.2, file="./output.rda")
# np = length(grep("lag", colnames(res[,,1])))
# dnemoutput(G, file1="./output.rda", file2="./outputfinal.rda", burnin=1000, np=np,T=T, 0.4)
#}
simulatePerturbation = function(Psi, T, k){
dynoNEM.perturb(Psi, T, k)
}
simulateData = function(net, T, decay=0.5, discrete=FALSE, nrepl=1){
n = nrow(net$network)
m = length(net$posEgenes)
D = array(0, dim=c(T, m, n))
for(k in 1:n){
pertS = simulatePerturbation(net$network, T, k)
for(t in 1:T){
effected = unique(which(net$posEgenes %in% which(pertS[,t]==1)))
not_effected = setdiff(1:m, effected)
if(!discrete){
b = sample(5:50,1) # sample a random a
a = sample(seq(0.1,0.9,by=0.1),1)
l = c(sample(seq(0.01,0.49,by=0.01),1),sample(seq(0.01,0.49,by=0.01),1)) # sample mixing coefficient
best = max(2,rnorm(1,b,b/10)) # put some noise on b
aest = min(max(0.1,rnorm(1,a,0.05)),0.9) # and on a as well
lest = pmax(0.01,l+rnorm(2,0,0.05))
#cat("sample parameters: (alpha=",asamp,"beta=",bsamp,"lambda=",lsamp,")\n")
D[t, effected,k] = nem:::bum.ralt(length(effected),c(a,b),c(1-sum(l),l[1],l[2])) #sample p-values for effected genes => aus H1 ziehen
D[t, not_effected,k] = runif(length(not_effected)) # ... and not effected ones => aus H0 ziehen
D[t,,k] = nem:::bum.dalt(D[t,,k],c(aest,best),c(1-sum(lest),lest[1],lest[2]))
}
else{
a = sample(c(0.01, 0.05, 0.1, 0.2, 0.3), 1)
b = sample(c(0.01, 0.05, 0.1, 0.2, 0.3), 1)
D[t, effected, k] = rbinom(length(effected), nrepl, p=(1-a))
D[t, not_effected, k] = rbinom(length(not_effected), nrepl, p=b)
}
}
}
if(!discrete)
D[D == 0] = min(D[D > 0])
sgenes = paste("S",seq(1,n,1),sep="")
dimnames(D) = list(as.character(1:T), as.character(1:m), sgenes)
D
}
sampleKEGGPathway = function(graphs, nacc, n){
mygraph = sample(graphs, 1)
mynacc = nacc[[names(mygraph)]]
mygraph = mygraph[[1]]
u_mygraph = ugraph(mygraph)
start = names(sample(mynacc[mynacc >= n],1))
mynodes = start
no = start
while(length(mynodes) < n){
nei = adj(u_mygraph, no)
no = sample(nei[[1]], 1)[[1]]
if(!(no %in% mynodes))
mynodes = c(mynodes, no)
}
S = subGraph(mynodes, mygraph)
S = removeSelfLoops(S)
S
}
sampleRandomGraph = function(n, p=2/n){
require(igraph)
S = erdos.renyi.game(n, p, directed=T)
S = get.adjacency(S)
S = as(S, "graphNEL")
S
}
sample.DNEM.structure = function(S, m, Tmax=4, attach="uniform", decay=0.5, prob=0.5){
n = ncol(S)
sgenes = paste("S",seq(1,n,1),sep="")
colnames(S) = sgenes
rownames(S) = sgenes
Strans = nem:::transitive.closure(S, mat=T, loops=F)
Strans[Strans==1] = pmin(rgeom(sum(Strans), prob=prob) + 1, Tmax)
# correct time lags: indirect edges have to be faster than direct ones in order to be observable
for(y in 1:nrow(Strans)){
for(x in 1:nrow(Strans)){
if(Strans[x,y] != 0){
for(j in 1:nrow(S)){
if((Strans[y,j] != 0) && (Strans[x,j] > 1) && (Strans[x,j] >= Strans[y,j] + Strans[x,y]))
Strans[x,j] = Strans[y,j] + Strans[x,y] - 1
}
}
}
}
edges = which(S == 1)
S[edges] = Strans[edges]
if(attach=="uniform") # uniform distribution of E-genes
epos = sample(1:n,m,replace=TRUE) # position of E-genes uniform
else if(attach %in% c("downstream","upstream")){ # E-genes preferentially downstream or upstream
g = as(S,"graphNEL")
startnode = which.min(apply(S,2,sum)) # start with node with minimal in-degree
visit = bfs(g,nodes(g)[startnode])
dis = 0:(n-1)
names(dis) = visit
r = 1 - decay*dis/(n-1)
r = r/sum(r)
if(attach == "downstream")
r = rev(r)
epos = sample(1:n,m,replace=TRUE,prob=r)
}
list(network=S,posEgenes=epos)
}
networkInference = function(D, net, method="dynoNEM", usePrior="sparse", fracErr=0, fracKnown=0.25, discrete=FALSE){ # perform network inference and evaluate the best model
print(usePrior)
original = (net$network > 0)*1
posEgenes = net$posEgenes
nrS = NCOL(original)
if(usePrior != "no"){
if(length(grep("sparse", usePrior) > 0))
priorPHI = diag(nrS)
else{
priorPHI = matrix(0.4,ncol=nrS,nrow=nrS)
dimnames(priorPHI) = dimnames(original)
known = which(original == 1)
nEdges = length(known)
r = sample(1:nEdges, floor(fracKnown*nEdges))
priorPHI[known[r]] = 1
unknown = which(original == 0)
r = sample(1:length(unknown), floor(fracErr*length(unknown)))
priorPHI[unknown[r]] = 1
print((priorPHI>0.5)*1)
cat("total known edges = ",sum(priorPHI==1),"\n")
}
}
else
priorPHI = NULL
if(method == "dynoNEM")
elapsed=system.time(for(i in 1:1) est = dynoNEM(D, nu=c(0.01, 0.1, 1, 10, 100), discrete=discrete, nrep=1))[1]
else if(method =="simpleDNEM")
elapsed=system.time(for(i in 1:1) est = simpleDNEM(D, discrete=discrete))[1] # simple nem model
else if(method == "DNEM")
elapsed=system.time(for(i in 1:1) est = DNEM(D, priorNet=priorPHI))[1] # DNEM
else
stop("unknown method")
inferred = abs(est$network)
mse = mean((inferred - net$network)^2)
mat = (inferred > 0)*1
print("original:")
print(net$network)
print("inferred:")
print(inferred)
tp = sum(mat[original==1]==1,na.rm=TRUE)
tn = sum(mat[original==0]==0,na.rm=TRUE)
if(discrete & method == "simpleDNEM")
fp = sum(mat[transitive.closure(original, mat=TRUE, loops=F)==0]==1,na.rm=TRUE)
else
fp = sum(mat[original==0]==1,na.rm=TRUE)
fn = sum(mat[original==1]==0,na.rm=TRUE)
tpr = tp/(tp+fn)
fpr = fp/(fp+tn)
if(is.nan(tpr))
tpr = 1
cat("tpr = ",tpr,"\n")
cat("fpr = ",fpr,"\n")
cat("mse = ", mse, "\n")
print(paste("elapsed time (s) = ", elapsed))
list(tpr=tpr,fpr=fpr,mse=mse)
}
# x: either # E-genes or number of time points for a fixed number of E-genes (4*n)
# usePrior: which prior to use ("no" means pure ML estimate)
# xlabel: put '# time points', if dependency on # time points is computed
# fracKnown: number of known edges in prior network (not needed here)
test = function(n, x=c(1, 2, 5, 10, 20)*n, usePrior="sparse", xlabel="# E-genes", fracKnown=0, methods=c("dynoNEM","simpleDNEM"), discrete=FALSE, outputdir="."){
set.seed(123456789)
load("~/workingAt/trunk/dynoNEM/KEGGgraphs.rda")
pdf(file.path(outputdir, paste("sampledNetworks_",n,"Sgenes.pdf")))
subnets = list()
i = 0
while(i < 10){
cand.net = sampleKEGGPathway(graphs, nacc, n)
cand.net.mat = as(cand.net, "matrix")
exists.net = any(sapply(subnets, function(subn) all(subn == cand.net.mat))) # CAUTION: This is not an exact test for graph isomorphism!!!
if(!exists.net && (i < 9 || (i == 9 && length(tsort(cand.net)) == 0))){ # at least one graph has to have a cycle
i = i + 1
plot(cand.net)
subnets[[i]] = cand.net.mat
}
}
dev.off()
ntrials = 100
if(usePrior == "no" | usePrior=="sparse")
fracKnown = 0
results = array(0, dim=c(10, 3, ntrials, length(x), length(methods)))
dimnames(results)[[2]] = c("tpr", "fpr", "mse")
dimnames(results)[[5]] = methods
for(s in 1:length(subnets)){
g = subnets[[s]]
for(m in 1:length(x)){
res = mclapply(1:ntrials, function(i){
restmp = array(dim=c(3, length(methods)))
if(xlabel == "# E-genes"){
net = sample.DNEM.structure(g, x[m])
D = simulateData(net, T=10, discrete=discrete)
}
else if(xlabel == "# time points"){
net = sample.DNEM.structure(g, 10*n)
D = simulateData(net, T=x[m], discrete=discrete)
}
else if(xlabel == "parameter p"){
net = sample.DNEM.structure(g, 10*n, prob=x[m])
D = simulateData(net, T=10, discrete=discrete)
}
else
stop("unknown test procedure")
for(method in 1:length(methods)){
res = networkInference(D, net, methods[method],usePrior=usePrior, fracKnown=fracKnown, discrete=discrete)
restmp[,method] = unlist(res)
}
restmp
}, mc.cores=7)
for(i in 1:ntrials)
results[s,,i,m,] = res[[i]]
for(method in 1:length(methods)){
cat("method: ", methods[method],"\n\n")
print(paste("--> mean % tpr (", xlabel, " =", x[m],") = ", rowMeans(results[s,,,m,method])[1]))
print(paste("--> mean % fpr (", xlabel, " =", x[m],") = ", rowMeans(results[s,,,m,method])[2]))
print(paste("--> mean MSE (", xlabel, " =", x[m],") = ", rowMeans(results[s,,,m,method])[3]))
cat("====================================\n")
}
}
}
save(results,file=file.path(outputdir, paste("results_n",n, "_", xlabel, "_", usePrior, "_", fracKnown, ".rda",sep="")))
pdf(file.path(outputdir, paste("sensitivity_n",n, "_", xlabel, "_", usePrior, "_", fracKnown, ".pdf", sep="")))
plot(x,seq(0,100,length.out=length(x)),type="n",main=paste("n = ",n),xlab=xlabel, ylab="sensitivity (%)")
for(method in 1:length(methods)){
means = 100*apply(apply(results[,1,,,method],c(3,1), mean), 1, mean)
sds = 100*apply(apply(results[,1,,,method],c(3,1), mean), 1, sd)
lines(x, means, lty=method, lwd=2, type="b")
errbar(x,means,means+sds,means-sds,xlab=xlabel,ylab="sensitivity (%)",main=paste("n = ",n),ylim=c(0,100),type="p", add=TRUE, lwd=2)
}
legend("bottomright", methods, lty=1:length(methods))
dev.off()
pdf(file.path(outputdir, paste("specificity_n",n, "_", xlabel, "_", usePrior, "_", fracKnown, ".pdf", sep="")))
plot(x,seq(0,100,length.out=length(x)),type="n",main=paste("n = ",n),xlab=xlabel, ylab="1 - fpr (%)")
for(method in 1:length(methods)){
means = 100*(1 - apply(apply(results[,2,,,method],c(3,1), mean), 1, mean))
sds = 100*apply(apply(results[,2,,,method],c(3,1), mean), 1, sd)
lines(x, means, lty=method, lwd=2, type="b")
errbar(x,means,means+sds,means-sds,xlab=xlabel,ylab="1 - fpr (%)",main=paste("n = ",n),ylim=c(0,100),type="p", add=TRUE, lwd=2)
}
legend("bottomright", methods, lty=1:length(methods))
dev.off()
pdf(file.path(outputdir, paste("MSE_n",n, "_", xlabel, "_", usePrior, "_", fracKnown, ".pdf", sep="")))
method = which(methods=="dynoNEM")
plot(x,seq(0,max(results[,3,,,method]),length.out=length(x)),type="n",main=paste("n = ",n),xlab=xlabel, ylab="MSE")
#for(method in 1:length(methods)){
means = apply(apply(results[,3,,,method],c(3,1), mean), 1, mean)
sds = apply(apply(results[,3,,,method],c(3,1), mean), 1, sd)
lines(x, means, lty=method, lwd=2, type="b")
errbar(x,means,means+sds,means-sds,xlab=xlabel,type="p", add=TRUE, lwd=2)
#}
#legend("bottomright", methods, lty=1:length(methods))
dev.off()
results
}
analyze.topologies = function(){
require(ggplot2)
load("/home/bit/frohlich/workingAt/trunk/dynoNEM/simresults/results_n5_# time points_sparse_0.rda")
times = c(3, 4, 6, 8, 10)
for(T in 1:5){
sens = data.frame(sensitivity=rbind(results[,1,,T,1], results[,1,,T,2]), method=as.factor(rep(c("dynoNEM", "simpleDNEM"), each=10)), network=as.factor(rep(1:10,2)))
sens = reshape(sens, varying=grep("sensitivity", colnames(sens)), times=1:100, timevar="trial", v.names="sensitivity", direction="long")
spec = data.frame(specificity=1-rbind(results[,2,,T,1], results[,2,,T,2]), method=as.factor(rep(c("dynoNEM", "simpleDNEM"), each=10)), network=as.factor(rep(1:10,2)))
spec = reshape(spec, varying=grep("specificity", colnames(spec)), times=1:100, timevar="trial", v.names="specificity", direction="long")
qplot(network, sensitivity, data=sens, geom="boxplot", fill=method) + theme_bw() + scale_fill_grey(end=1, start=0.5) + opts(axis.text.x = theme_text(hjust=1, angle=45), strip.text.x = theme_text(angle=90))
ggsave(paste("/home/bit/frohlich/workingAt/trunk/dynoNEM/simresults/results_n5_networkArchitecture_sens_T",times[T],".pdf",sep=""))
qplot(network, specificity, data=spec, geom="boxplot", fill=method) + theme_bw() + scale_fill_grey(end=1, start=0.5) + opts(axis.text.x = theme_text(hjust=1, angle=45), strip.text.x = theme_text(angle=90))
ggsave(paste("/home/bit/frohlich/workingAt/trunk/dynoNEM/simresults/results_n5_networkArchitecture_spec_T",times[T],".pdf", sep=""))
}
}
|
ac15b9cfc64b28b0760286055fb01d83efdc1722
|
482a02ade2e54a1665724c1c61bbb1b3615a15a3
|
/man/c-meta-method.Rd
|
18adac7bb90104ab5c0eb9c75bbbac639fcb1349
|
[
"BSD-3-Clause",
"CC0-1.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
amoeba/RNeXML
|
f1858be4ff41c8cecf7dda9da80eff021c13622e
|
288c219afc7fbf594ae077a815e57477f0b8bea9
|
refs/heads/master
| 2021-05-08T08:37:21.922452
| 2017-05-04T03:25:58
| 2017-05-04T03:25:58
| 107,053,765
| 0
| 0
| null | 2017-10-15T22:27:48
| 2017-10-15T22:27:48
| null |
UTF-8
|
R
| false
| true
| 708
|
rd
|
c-meta-method.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/meta.R
\docType{methods}
\name{c,meta-method}
\alias{c,meta-method}
\title{Concatenate meta elements into a ListOfmeta}
\usage{
\S4method{c}{meta}(x, ..., recursive = FALSE)
}
\arguments{
\item{x, ...}{meta elements to be concatenated, e.g. see \code{\link{meta}}}
\item{recursive}{logical, if 'recursive=TRUE', the function
descends through lists and combines their elements into a vector.}
}
\value{
a listOfmeta object containing multiple meta elements.
}
\description{
Concatenate meta elements into a ListOfmeta
}
\examples{
c(meta(content="example", property="dc:title"),
meta(content="Carl", property="dc:creator"))
}
|
3452c80a2d959520b52eddf2475b42d21850e6d7
|
cad506b49106d267e20433fca31963a7a4218e42
|
/man/gBoundingPolyClip.Rd
|
4cb19d0c142bbc4268a0cf2b6b4e2a6b412618b3
|
[] |
no_license
|
townleym/mSpatial
|
929f674e1dacd148c912504b3d7270cfc7d41d91
|
9e7d790813f779806736f1fba5b8341827ce329a
|
refs/heads/master
| 2020-05-21T23:13:22.945779
| 2018-02-07T19:34:02
| 2018-02-07T19:34:02
| 59,143,578
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| true
| 1,143
|
rd
|
gBoundingPolyClip.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mSpatial.R
\name{gBoundingPolyClip}
\alias{gBoundingPolyClip}
\title{bounding box clip function}
\usage{
gBoundingPolyClip(container, reference, tolerance = 1.5)
}
\arguments{
\item{container}{The single polygon to whose extent the reference polygons will be included}
\item{reference}{The set of polygons that will be selected down to the reference polygon}
\item{tolerance}{The multiple by which the extent of the reference polygon will be expanded (default = 1.5)}
}
\description{
This function clips a set of reference polygons to some multiple of the extent of a container polygon. It is most useful for reducing a large set of polygons (e.g. US Census Block groups) to a smaller subset. \strong{New!} it now returns full intersecting polygons rather than the clipped slivers. And if reference is a SpatialPolygonsDataFrame it will return a SpatialPolygonsDataFrame (yay!)
}
\details{
\strong{Note}: all inputs should be of class \code{sp::SpatialPolygons|Points}
}
\examples{
gBoundingPolyClip(drivetime, block_groups, tolerance = 1.25)
}
\keyword{spatial}
|
31e123eb63bf6e216df8b605cecd86c4af682aac
|
362918b03c7e38aead95067cc49c3f242d60e24f
|
/processing_ts_interaction_data.R
|
3af53dcd92541ceed03111b2ce483bb052757941
|
[] |
no_license
|
wangdi2014/cancer_ML
|
493efd4d1cbe8fe74ce96635769b6c2f714950bb
|
3002f26ffd79f57d26f765cc7d2dc4f115c5839b
|
refs/heads/master
| 2021-05-16T16:19:27.298050
| 2016-07-27T22:29:34
| 2016-07-27T22:29:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 4,603
|
r
|
processing_ts_interaction_data.R
|
# Processing iid data
require(dplyr)
require(tidyr)
require(igraph)
iid <- read.csv("~/Projects/fusion_ML/data/network_data/iid.human.2016-03.txt", sep="\t")
head(iid); nrow(iid)
# get just uniprot and tissue presence
iid <- iid %>% select(uniprot1, uniprot2, adipose.tissue:uterus)
# replace empty cells with explicit NA
iid[iid==""] <- NA
nrow(iid)
test <- iid
head(test)
# define network metrics
metrics <- c(
"n_vertices", "n_edges",
"diameter", "avg_path_length",
"num_articulation_points", "cohesion", "clique_number",
"edge_connect", "vertex_connect",
"degree_median", "degree_mean", "degree_sd",
"betweenness_median",
"closeness_median",
"network_computation_time")
# set up graph object
convert_to_clean_graph <- function(data, feature_number){
graph <-
data %>% select(uniprot1, uniprot2, feature_number) %>% na.omit() %>%
select(uniprot1, uniprot2) %>% graph.data.frame(directed = FALSE)
return(graph)
}
num_tissues <- ncol(test[3:ncol(test)])
ts_network_report <- matrix(nrow = 30, ncol = 15)
for (i in 1:num_tissues){
t_start <- proc.time()
graph = convert_to_clean_graph(data = test, feature_number = i+2)
# number of vertices, edges
n_vertices <- length(V(graph)); cat("Finished ", metrics[1], "\n")
n_edges <- length(E(graph)); cat("Finished ", metrics[2], "\n")
# get diameter
diameter <- diameter(graph); cat("Finished ", metrics[3], "\n")
avg_path_length <- average.path.length(graph); cat("Finished ", metrics[4], "\n")
# articulation points
num_articulation_points <- length(articulation.points(graph)); cat("Finished ", metrics[5], "\n")
# cohesion, cliques
cohesion <- cohesion(graph); cat("Finished ", metrics[6], "\n")
clique_number <- clique.number(graph); cat("Finished ", metrics[7], "\n")
# group adhesion (edge connectivity)
edge_connect <- edge.connectivity(graph); cat("Finished ", metrics[8], "\n")
# group cohesions (vertex connectivity)
vertex_connect <- vertex.connectivity(graph); cat("Finished ", metrics[9], "\n")
#### average centrality measures
# degree centrality
degree_median <- median(degree(graph)); cat("Finished ", metrics[10], "\n")
degree_mean <- mean(degree(graph)); cat("Finished ", metrics[11], "\n")
degree_sd <- sd(degree(graph)); cat("Finished ", metrics[12], "\n")
# betweenness centrality
betweenness_median <- median(betweenness(graph)); cat("Finished ", metrics[13], "\n")
#betweenness_mean <- mean(betweenness(graph))
#betweenness_sd <- sd(betweenness(graph))
# closeness centrality
closeness_median <- median(closeness(graph)); cat("Finished ", metrics[14], "\n")
#closeness_mean <- mean(closeness(graph))
#closeness_sd <- sd(closeness(graph))
# build network summary report
ts_network_report[i,1] <- n_vertices
ts_network_report[i,2] <- n_edges
ts_network_report[i,3] <- diameter
ts_network_report[i,4] <- avg_path_length
ts_network_report[i,5] <- num_articulation_points
ts_network_report[i,6] <- cohesion
ts_network_report[i,7] <- clique_number
ts_network_report[i,8] <- edge_connect
ts_network_report[i,9] <- vertex_connect
ts_network_report[i,10] <- degree_median
ts_network_report[i,11] <- degree_mean
ts_network_report[i,12] <- degree_sd
ts_network_report[i,13] <- betweenness_median
ts_network_report[i,14] <- closeness_median
ts_network_report[i,15] <- (proc.time() - t_start)[3]
cat("Finished network number ", i)
}
# output final result
ts_network_report_df <- as.data.frame(ts_network_report, row.names = colnames(test)[3:32])
colnames(ts_network_report_df) <- c(
"n_vertices", "n_edges",
"diameter", "avg_path_length",
"num_articulation_points", "cohesion", "clique_number",
"edge_connect", "vertex_connect",
"degree_median", "degree_mean", "degree_sd",
"betweenness_median",
"closeness_median",
"network_computation_time"
)
ts_network_report_df
write.table(ts_network_report_df, "~/Projects/fusion_ML/data/network_data/ts_ts_network_report_df.csv", sep=",", quote = FALSE, row.names = TRUE)
# trying to modularize everything
initialize_network_report_matrix <- function(number_of_tissues, number_of_metrics){
ts_network_report <- matrix(nrow = number_of_tissues, ncol = number_of_metrics)
}
build_network_report_matrix <- function(network_results, number_of_metrics) {
}
output_network_report <- function(network_report_matrix, row_names, col_names){
ts_network_report_df <- as.data.frame(network_report_matrix, row.names = row_names)
colnames(ts_network_report_df) <- col_names
return(ts_network_report_df)
}
|
726dcb599ac64da55aa207128b0c1bd4cb3e2851
|
82570b0adbd25e40ac5f863f12228ddcd760f1b9
|
/assignment_4/forest_growth.R
|
3e3eba48cdcd011b9edb3631c9f49662f7e87611
|
[] |
no_license
|
annaclairemarley/env_modeling
|
2d779149ed1f72d2fea00febbd469316daab8c93
|
673b9855be0dbc2d22fd4416a4a6227e1d732b0d
|
refs/heads/master
| 2022-09-24T03:16:16.630012
| 2020-06-01T20:34:57
| 2020-06-01T20:34:57
| 255,961,048
| 2
| 1
| null | null | null | null |
UTF-8
|
R
| false
| false
| 985
|
r
|
forest_growth.R
|
#' forest_growth
#'
#' @param time time
#' @param C initial carbon (kg C)
#' @param parms$canopy_thresh canopy closure threshold (kg C)
#' @param parms$K carrying capacity (kg C)
#' @param parms$r initial growth rate (kg/year)
#' @param parms$g linear growth rate (kg/year)
#' @param parms$temp temperature (degrees C)
#'
#' @return growth rate of forest at any point in time
#' @export
#'
#' @examples
forest_growth = function(time, C, parms){
# rate of forest growth
carb_change = parms$r*C
# forest growth is 0 when temperatures are below 0
if (parms$temp < 0){
carb_change = 0
# forest growth is 0 when carrying capacity is reached
} else if (C >= parms$K) {
carb_change = 0
# forest growth becomes linear when carbon is above the threshold canopy closure
} else if (C > parms$canopy_thresh){
carb_change = parms$g
} else {
carb_change = carb_change
}
return(list(carb_change))
}
|
16190df30a867cf7ffd3ffc3ee5eafa6d5120be9
|
d54431bde7faa4032d044991668845269188772e
|
/Formação Cientista de Dados/Atividades/Estatística I em R/5 - Distribuição T de Student.R
|
7123fb120a2df1c880c5607805ba679e9341e232
|
[] |
no_license
|
lucianofbn/Data-Scientist
|
194ea599cb078898d71f5c4e758076345e8e8ff6
|
bf250e2d3a277e68f46077fd455875d2fe99d369
|
refs/heads/master
| 2020-03-30T05:25:25.598165
| 2018-10-13T03:18:30
| 2018-10-13T03:18:30
| 150,797,887
| 1
| 0
| null | null | null | null |
ISO-8859-1
|
R
| false
| false
| 522
|
r
|
5 - Distribuição T de Student.R
|
# -> Distribuição T de Student - Indicada para amostras menores que 30.
#1 Uma pesquisa mostra que cientistas de dados ganham 75R$/h. Uma amostra de 9 cientistas é apresentada e perguntado o salário.
# média = 75, amostra = 9, dp = 10; Necessário verificar tabela Z.
#1.1 Qual a probabilidade de selecionar um cientista de dados e o salário ser menor que 80R$/h?
pt(1.5, 8)
#1.2 Qual a probabilidade de selecionar um cientista de dados e o salário ser maior que 80R$/h?
pt(1.5,8, lower.tail = F)
1 - pt(1.5, 8)
|
6248367de1a9326a2722c983252a31891dd65fe4
|
4fd601fe02311d3babf47dcfa0f5a37caee59b7d
|
/plot_rDNA_shifted.R
|
3ec19b7542c7f6e6ac44286dedf5313c5ad1336c
|
[] |
no_license
|
hochwagenlab/Condensin_recruitment
|
b5a3733059d4fe35aa106a3018b48c19074a8ba7
|
1a290a7ab96c3457b2eaadc781e29e6a2e1a3535
|
refs/heads/master
| 2022-11-18T11:31:13.877177
| 2020-07-20T23:48:53
| 2020-07-20T23:48:53
| 281,249,184
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 3,193
|
r
|
plot_rDNA_shifted.R
|
setwd("rDNA_shifted/")
plotPrep <- function(rDNA, tilesize) {
rDNA <- sort(GenomeInfoDb::sortSeqlevels(rDNA))
seqlens <- 9242
names(seqlens) <- "rDNA"
bins <- GenomicRanges::tileGenome(seqlens, tilewidth=tilesize,
cut.last.tile.in.chrom=TRUE)
rDNAscore <- GenomicRanges::coverage(rDNA, weight="score")
bins <- GenomicRanges::binnedAverage(bins, rDNAscore, "rDNA_score")
positions <- bins@ranges@start + floor(bins@ranges@width / 2)
out <- data.frame(position=positions, rDNA=bins$rDNA_score)
return(out)
}
AH6408I <- rtracklayer::import.bedGraph("AH6408I-144-183-rDNA_shift_W3_MACS2_FE.bdg.gz")
AH6408Ip <- plotPrep(AH6408I,tilesize=2)
AH7797I <- rtracklayer::import.bedGraph("AH7797I-V5-185-148-rDNA_shift_W3_MACS2_FE.bdg.gz")
AH7797Ip <- plotPrep(AH7797I,tilesize=2)
YLIM <- c(0,max(c(AH6408Ip$rDNA,AH7797I$rDNA)))
pdf("AH6408I-rDNA_shifted.pdf")
plot(AH7797Ip$position,AH7797Ip$rDNA, xlab='rDNA', ylab='Average signal', type='l', lwd=2,col="darkgrey",ylim=YLIM,main="AH6408I")
points(AH6408Ip$position,AH6408Ip$rDNA, type='l', lwd=2,col="darkblue")
abline(h=1,col="grey60")
hwglabr::plot_gene_arrow(geneEnd=5508,geneLength=8903-5508,orientation=-1,yPos=0) #RDN25
hwglabr::plot_gene_arrow(geneEnd=562,geneLength=2361-562,orientation=-1,yPos=0) #RDN18
hwglabr::plot_gene_arrow(geneEnd=4304,geneLength=4424-4304,orientation=-1,yPos=0) #RDN5
dev.off()
AH6408B <- rtracklayer::import.bedGraph("AH6408B-28-37-77-rDNA_shift_W3_MACS2_FE.bdg.gz")
AH7797B <- rtracklayer::import.bedGraph("AH7797B-noreson-rDNA_shift_W3_MACS2_FE.bdg.gz")
AH6408Bp <- plotPrep(AH6408B,tilesize=2)
AH7797Bp <- plotPrep(AH7797B,tilesize=2)
YLIM <- c(0,max(c(AH6408Bp$rDNA,AH7797Bp$rDNA)))
pdf("AH6408B-rDNA_shifted.pdf")
plot(AH7797Bp$position,AH7797Bp$rDNA, xlab='rDNA', ylab='Average signal', type='l', lwd=2,col="darkgrey",ylim=YLIM,main="AH6408B")
points(AH6408Bp$position,AH6408Bp$rDNA, type='l', lwd=2,col="darkblue")
abline(h=1,col="grey60")
hwglabr::plot_gene_arrow(geneEnd=5508,geneLength=8903-5508,orientation=-1,yPos=0) #RDN25
hwglabr::plot_gene_arrow(geneEnd=562,geneLength=2361-562,orientation=-1,yPos=0) #RDN18
hwglabr::plot_gene_arrow(geneEnd=4304,geneLength=4424-4304,orientation=-1,yPos=0) #RDN5
dev.off()
AH6408K <- rtracklayer::import.bedGraph("AH6408k-PK9-751-375-rDNA_shift_W3_MACS2_FE.bdg.gz")
AH7797K <- rtracklayer::import.bedGraph("AH7797K-PK9-755-377-rDNA_shift_W3_MACS2_FE.bdg.gz")
AH6408Kp <- plotPrep(AH6408K,tilesize=2)
AH7797Kp <- plotPrep(AH7797K,tilesize=2)
YLIM <- c(0,max(c(AH6408Kp$rDNA,AH7797Kp$rDNA)))
pdf("AH6408K-rDNA_shifted.pdf")
plot(AH7797Kp$position,AH7797Kp$rDNA, xlab='Position on rDNA', ylab='Average signal', type='l', lwd=2,col="darkgrey",ylim=YLIM,main="AH6408K")
points(AH6408Kp$position,AH6408Kp$rDNA, type='l', lwd=2,col="darkblue")
abline(h=1,col="grey60")
hwglabr::plot_gene_arrow(geneEnd=5508,geneLength=8903-5508,orientation=-1,yPos=0) #RDN25
hwglabr::plot_gene_arrow(geneEnd=562,geneLength=2361-562,orientation=-1,yPos=0) #RDN18
hwglabr::plot_gene_arrow(geneEnd=4304,geneLength=4424-4304,orientation=-1,yPos=0) #RDN5
dev.off()
|
5bf19c9a1e3337ab8d7082914aa867c77f5f7af8
|
6a957d4125a6e9ec70ed76caa86976bcb7186710
|
/article/script_cytof.R
|
b3812073ee94824e550f5d9b3103c78c71d914aa
|
[] |
no_license
|
sysbiosig/FRA
|
23456ed6233fe2e72bdd71a000fdb4615974c84b
|
e81f37d43033f9ac6521949f60f5576276ac27f7
|
refs/heads/master
| 2023-04-11T11:49:48.944301
| 2021-07-07T05:53:50
| 2021-07-07T05:53:50
| 260,541,193
| 0
| 1
| null | 2021-07-06T11:15:57
| 2020-05-01T19:25:48
|
R
|
UTF-8
|
R
| false
| false
| 4,909
|
r
|
script_cytof.R
|
### ###
### Main plots for CyTOF data presented in the Manuscript and SI
### ###
# Please download cytof data from : 10.5281/zenodo.4646713
# and save the umder diredctory CYTOF_PATH
CYTOF_PATH <- "path/to/cytof/files" # define CYTOF_PATH
CYTOF_PATH <- "data" # define CYTOF_PATH
path <- paste(CYTOF_PATH, "data.fra.cytof.all_cell_types.rds", sep = "/")
data.cytof.all_cell_types <- readRDS(path)
head(data.cytof.all_cell_types)
path <- paste(CYTOF_PATH, "data.fra.cytof.list.rds", sep = "/")
data.cytof.list <- readRDS(path)
#### t-SNE plot ####
require(Rtsne)
require(tidyverse)
require(data.table)
require(foreach)
# markers used to identyfication of cell types
gating.colnames <- c("HLA-DR", "CD11c", "CD123", "CD14", "CD16", "CD19", "CD20", "CD3", "CD38", "CD45", "CD56", "CD8")
samples_num <- 10000
data.cytof.all_cell_types[sample(samples_num, x = 1:nrow(data.cytof.all_cell_types)),] -> data.train
data.train %>%
dplyr::select(!!gating.colnames) %>%
as.matrix() -> data.train.matrix
# Rtsne returns tsne coordinates
# coordinates are not deterministic and depends on methods parameters
tsne <- Rtsne(data.train.matrix,
dims = 2,
perplexity=30,
verbose=TRUE,
max_iter = 500)
Y <- tsne$Y
colnames(Y) <- c("tsne1", "tsne2")
data.train %>%
cbind(Y) ->
data.train
# tsne1 and tsne2 are used to plot cell position
xlim_ <- c(-25, 25)
ylim_ <- xlim_
xlab_ <- "TSNE-1"
ylab_ <- "TSNE-2"
g.classes <-
ggplot(
data.train,
aes(x = tsne1,
y = tsne2)) +
coord_cartesian(xlim = xlim_, ylim = ylim_) +
geom_point(
alpha = 0.1,
color = "gray") +
FRA::theme_scrc() +
geom_point(
data = data.train %>% dplyr::filter(!is.na(cell_type)),
mapping = aes(color = cell_type, fill = cell_type),
alpha = 1) +
xlab(xlab_) +
ylab(ylab_) +
scale_fill_viridis(discrete = TRUE, option = "C", guide = FALSE
) +
scale_color_viridis(discrete = TRUE,
option = "C",
name = "Cell Type"
)
print(g.classes)
#### TSNE grid Sup Figure 2####
#variables.list <- c("pSTAT1", "pSTAT3", "pSTAT4", "pSTAT5", "pSTAT6", "STAT1", "STAT3", "IFNAR1", "IFNAR2")
variables.list <- c("pSTAT1", "pSTAT3", "pSTAT4", "pSTAT5", "pSTAT6")
stim.list <- (data.train %>% dplyr::distinct(Stim) %>% dplyr::arrange(Stim))[["Stim"]]
foreach(variable_ = variables.list) %do% {
# color.limits_ <-
# as.numeric((data.train %>% dplyr::summarise_(
# min = paste("min(", variable_ ,")"),
# max = paste("quantile(", variable_ ,", prob = 0.975)")
# ))[c("min", "max")])
color.limits_ <- c(0,1)
variable.normalization <-
as.numeric((data.train %>% dplyr::summarise_(
min = 0, #paste("min(", variable_ ,")"),
max = paste("quantile(", variable_ ,", prob = 0.975)")
))[c("min", "max")])
mutate.expr <- quos((!!sym(variable_) - variable.normalization[1])/(variable.normalization[2] - variable.normalization[1]))
names(mutate.expr) <- variable_
g.list <- foreach(stim_ = stim.list) %do% {
ggplot(
data.train %>%
dplyr::filter(Stim == stim_) %>%
dplyr::mutate(!!!mutate.expr) -> data.train.test,
aes_string(x = "tsne1",
y = "tsne2",
color = variable_,
fill = variable_)) +
coord_cartesian(xlim = xlim_, ylim = ylim_) +
geom_point(
alpha = 1) +
FRA::theme_scrc() +
scale_color_viridis(
#guide = "none",
begin = 0.1,
limits = color.limits_) +
scale_fill_viridis(
guide = "none",
begin = 0.1,
limits = color.limits_) +
ggtitle(paste("IFNa:", stim_, "ng/ml"))
}
g.grid <- plot_grid(plotlist = g.list, ncol = 1)
return(g.grid)
} %>%
plot_grid(plotlist = .,
ncol = length(variables.list)) ->
g.grid
#### Computing FRA ####
require(FRA)
model.list <- list()
frc.list <- list()
fra_pie_charts.list <- list()
parallel_cores = 2
bootstrap.number = 8
response_ = c("pSTAT1", "pSTAT3", "pSTAT4", "pSTAT5", "pSTAT6")
cell_type.list <- names(data.cytof.list)
for( cell_type in cell_type.list) {
model.list[[cell_type]] <-
FRA::FRA(
data = data.cytof.list[[cell_type]],
signal = "Stim",
response = response_,
parallel_cores = parallel_cores,
bootstrap.number = bootstrap.number)
print(model.list[[cell_type]])
frc.list[[cell_type]] <- FRA::plotFRC(model = model.list[[cell_type]], title_ = cell_type)
fra_pie_charts.list[[cell_type]] <- FRA::plotHeterogeneityPieCharts(model = model.list[[cell_type]], title_ = cell_type)
}
cowplot::plot_grid(plotlist = frc.list,
ncol = length(cell_type.list)) ->
g.frc
print(g.frc)
plot_grid(plotlist = fra_pie_charts.list,
ncol = length(cell_type.list)) ->
g.fra_pie_charts
print(g.fra_pie_charts)
|
68d90f1f507510a78a0b692a79bc989f517e573b
|
6ac55e9eb21c4a8df6f7b1b30d0aec6bc8bfcfdb
|
/09_plotByChr.r
|
da818027713c4ce5b9053774d04b316e118e4042
|
[] |
no_license
|
raramayo/R_vikas0633
|
c7b9efecaa21699510e9422cd8049d6e3caa21bc
|
44b04ab0bbdfb4fd3e660d1a0c01b618ed32f100
|
refs/heads/master
| 2022-05-03T07:38:29.384021
| 2014-12-09T13:12:33
| 2014-12-09T13:12:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 968
|
r
|
09_plotByChr.r
|
jpeg("~/Desktop/temp/comb.jpg", width=3600, height=2000, units="px")
chr=c(1,2,3,4,5,6)
par(mfcol=c(9,2), mar=c(2,2,0.5,0.5), oma=c(1,2,1,1))
tmp <- read.table('~/Desktop/temp/gph5_6_r_out_chr2_vikas.txt',header=T, sep="\t")
head(tmp)
names(tmp)
for(i in 1:length(chr)) {
tmp_chr <- tmp[which(chr[i]==tmp$chr),]
plot(tmp_chr$position,tmp_chr$percentage_parentA_pool1, type="p", main="this", col="blue", las=1, ann="FALSE", cex=0.3, cex.axis=0.6)
plot(tmp_chr$position,tmp_chr$percentage_parentA_pool2, type="p", main="this", col="red", las=1, ann="FALSE", cex=0.3, cex.axis=0.6)
plot(tmp_chr$position,tmp_chr$percentage_parentA_pool1, type="p", main="this", col="blue", las=1, ann="FALSE", cex=0.3, cex.axis=0.6)
points(tmp_chr$position,tmp_chr$percentage_parentA_pool2, col="red")
#points(tmp_chr$position,tmp_chr$difference_percentage_parentA_pool1.pool2,col="forestgreen")
#points(tmp_chr$position,tmp_chr$p_value_Fisher_s_exact_test,col="black")
}
dev.off()
|
14e3aea2a178dd6912d42de5e8bfb8bfb252740f
|
8f8b5e6ff5506be8af78dac47c4eedfc6356f29d
|
/R/as.R
|
96eef0833e0567b86143d0ca94d05218b0301af8
|
[
"Artistic-2.0"
] |
permissive
|
Theob0t/sttkit
|
228614505dff306e2140169f01ee8bb8f907825c
|
d86be80caba7384d5c7786e45ec2defae5da10aa
|
refs/heads/master
| 2023-07-30T06:00:49.834392
| 2021-10-06T23:19:46
| 2021-10-06T23:19:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 1,086
|
r
|
as.R
|
#' as_SingleCellExperiment
#'
#' Convert Seurat Visium object for BayesSpace. Currently only works for single
#' sample objects.
#' @param object Seurat Visium object
#' @param ... Arguments passed to \code{spatialPreprocess}
#' @export as_SingleCellExperiment
#' @examples
#' # as_SingleCellExperiment(object)
as_SingleCellExperiment <- function(object, ...) {
if (!requireNamespace("SingleCellExperiment", quietly = TRUE)) {
stop("Install SingleCellExperiment.")
}
if (length(Images(object)) > 1) {
stop("Currently only single sample objects supported.")
}
x <- as.SingleCellExperiment(object)
if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
stop("Install SummarizedExperiment.")
}
SummarizedExperiment::colData(x) <- cbind(
SummarizedExperiment::colData(x),
object@images[[1]]@coordinates[rownames(SummarizedExperiment::colData(x)),]
)
if (requireNamespace("BayesSpace", quietly = TRUE)) {
x <- BayesSpace::spatialPreprocess(x, ...)
}
return(x)
}
|
244719983bae73a7bb9c9401433092f6e4eacc63
|
efb67b529095add05d77312f981305690655b45a
|
/ggplot2/Layers/Geoms/geom_boxplot/example8.R
|
87e486ceaa3a4b58fd4f4f086109324a24f42178
|
[] |
no_license
|
plotly/ssim_baselines
|
6d705b8346604004ae16efdf94e425a2989b2401
|
9d7bec64fc286fb69c76d8be5dc0899f6070773b
|
refs/heads/main
| 2023-08-14T23:31:06.802931
| 2021-09-17T07:19:01
| 2021-09-17T07:19:01
| 396,965,062
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 76
|
r
|
example8.R
|
p <- ggplot(mpg, aes(class, hwy))
p <- p + geom_boxplot(aes(colour = drv))
|
c8e203c0b967dd8bd4c56847e0f601cdfe8b6c1d
|
1f87cf8037ccdfb26ce4ac502b3a1337faf7e762
|
/man/build_form.Rd
|
64e4eccd07029a706f43d0224e5135273cae3c79
|
[
"MIT"
] |
permissive
|
npjc/biogridr
|
88c319d118ca871ec771bd5813a3243a6efdd810
|
af08515111489b8873f20374487c71f0226f57ee
|
refs/heads/master
| 2021-01-18T13:12:17.460678
| 2015-05-28T04:47:13
| 2015-05-28T04:47:13
| 36,135,592
| 4
| 4
| null | null | null | null |
UTF-8
|
R
| false
| false
| 277
|
rd
|
build_form.Rd
|
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/get_key.R
\name{build_form}
\alias{build_form}
\title{build form from elements}
\usage{
build_form(first, last, email, project)
}
\description{
build form from elements
}
\keyword{internal}
|
a6ae267406e746ae22397a8deff6116f84a1a19f
|
094f81c31a3cfd560b24280e476d5af4fb52b9e3
|
/man/leff.Rd
|
b95eaa5b094fb5421e7f8db5ffa83458cad08db2
|
[
"MIT"
] |
permissive
|
PJOssenbruggen/Basic
|
6c2343dcb135cb364d059160925ded5cb43b5455
|
1885fa40d3318cc554b4dd80154b263baef19ac4
|
refs/heads/master
| 2021-01-25T11:57:19.583401
| 2019-01-04T13:03:32
| 2019-01-04T13:03:32
| 123,449,454
| 0
| 0
| null | 2018-03-05T12:26:55
| 2018-03-01T14:56:48
|
R
|
UTF-8
|
R
| false
| true
| 321
|
rd
|
leff.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/leff.R
\docType{data}
\name{leff}
\alias{leff}
\title{\code{leff} vehicle length in feet.}
\format{\code{leff} a number.
\describe{
\item{leff}{a number}
}}
\usage{
leff
}
\description{
\code{leff} vehicle length in feet.
}
\keyword{datasets}
|
ba6cd4ac437d217ff85ac10e76327ae0b1b82563
|
550b5147909aa269b50af580c55f9e59f9c91d5e
|
/R/graph_from_corpus.r
|
4eb3241920ac8696debec6d6c1887a43784bd241
|
[] |
no_license
|
clbustos/SemanticFields
|
b96ca71308428e1afc740dc527e4acdbfca8356a
|
9ebfaa0044db74a2f3e349be0e30f8d832179c73
|
refs/heads/master
| 2021-01-15T11:50:18.353144
| 2015-10-16T18:43:39
| 2015-10-16T18:43:39
| 34,122,591
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 838
|
r
|
graph_from_corpus.r
|
#' Generate a Graph from igraph, using a data.frame with corpus structure or a corpus object
#' @param x a corpus object
#' @return a directed graph
#' @export
#' @import reshape
#' @import igraph
graphFromCorpus<-function(corpus) {
x<-corpus$corpus[,c("id","order","word","coi")]
x2<-x
base<-x2[x2$order==1,]
base$order<-0
base$word<-base$coi
x2<-rbind(base,x2)
#x2$coi<-NULL;
ss<-reshape::cast(x2,id~word,value="order")[,-1]
words<-colnames(ss)
lw<-length(words)
mm<-matrix(0,lw,lw,dimnames=list(words,words))
for(i in 1:(lw-1)) {
for(j in (i+1):lw) {
res<-as.numeric(ss[,i]<ss[,j])
antes<-sum(res,na.rm=T)
despues<-sum(!is.na(res))-antes
mm[i,j]<-antes
mm[j,i]<-despues
}
}
igraph::graph.adjacency(mm,mode="directed",weighted=T,diag=F)
}
|
758459a46c8420bb3ec26f8c016750e94503ac44
|
115630f80c1fa0b0439e2792dd30a127c7c2aec5
|
/man/gee.zelig-package.Rd
|
ddcad5d23372df69fc4071c991b5df399d4d9f63
|
[] |
no_license
|
zeligdev/ZeligGEE
|
e6f33bdb80ba164143b876bbf1ef706e15f29bc7
|
aca5ee15abe1872e8dec2df034b226e720605682
|
refs/heads/master
| 2020-05-20T10:17:23.450238
| 2012-10-05T21:27:53
| 2012-10-05T21:27:53
| 2,043,667
| 1
| 1
| null | null | null | null |
UTF-8
|
R
| false
| false
| 342
|
rd
|
gee.zelig-package.Rd
|
\name{gee.zelig-package}
\title{gee...}
\description{gee.zelig}
\details{\tabular{ll}{
Package: \tab gee.zelig\cr
Version: \tab 0.1\cr
Date: \tab 2011-04-25\cr
Depends: Zelig
License: \tab GPL version 2 or newer\cr
}
Edit this description}
\alias{gee.zelig-package}
\alias{gee.zelig}
\docType{package}
\author{Patrick Lam}
\keyword{package}
|
7a2645ca4651f70586a786888bddd56fe041e003
|
e2f37b60e1cd4fdf9c002cd267a79f2881b248dd
|
/R/SDP_uniform.R
|
ddfcfaebd67c9f111e99d3de4fe5dbad458e395a
|
[
"CC0-1.0"
] |
permissive
|
cboettig/pdg_control
|
8b5ac745a23da2fa7112c74b93765c72974ea9b9
|
d29c5735b155d1eb48b5f8b9d030479c7ec75754
|
refs/heads/master
| 2020-04-06T03:40:50.205377
| 2017-10-17T02:47:24
| 2017-10-17T02:47:24
| 2,390,280
| 7
| 2
| null | null | null | null |
UTF-8
|
R
| false
| false
| 4,409
|
r
|
SDP_uniform.R
|
#' Determine the SDP matrix for uniform noise under multiple uncertainty
#'
#' Computes the transition matrix under the case of growth noise,
#' implementation errors in harvesting, and meaurement errors in
#' the stock assessment. Assumes noise sources are distributed
#' by uniform distributions to obtain analytic transition probability densities.
#'
#' @param f the growth function of the escapement population (x-h)
#' should be a function of f(t, y, p), with parameters p
#' @param p the parameters of the growth function
#' @param x_grid the discrete values allowed for the population size, x
#' @param h_grid the discrete values of harvest levels to optimize over
#' @param sigma_g is the shape parameter (width) of the multiplicitive growth noise
#' @param pdfn is the shape of the growth noise, which need not be uniform (is by default)
#' @param sigma_m is the half-width of the uniform measurement error (assumes uniform distribution)
#' @param sigma_i is the half-width of the implementation noise (always assumes uniform distribution)
#' @param f_int is the function given by the analytic solution,
#' @export
SDP_uniform <- function(f, p, x_grid, h_grid, sigma_g,
pdfn=function(P, s) dunif(P, 1-s, 1+s),
sigma_m, sigma_i, f_int){
gridsize <- length(x_grid)
SDP_Mat <- lapply(h_grid, function(h){
SDP_matrix <- matrix(0, nrow=gridsize, ncol=gridsize)
# Cycle over x values
for(i in 1:gridsize){
## Calculate the expected transition
x1 <- x_grid[i]
x2_expected <- f_int(x1, h, sigma_m, sigma_i, p)
## If expected 0, go to 0 with probabilty 1
if( x2_expected == 0)
SDP_matrix[i,1] <- 1
else {
# relative probability of a transition to that state
ProportionalChance <- x_grid / x2_expected
Prob <- pdfn(ProportionalChance, sigma_g)
# Store normalized probabilities in row
SDP_matrix[i,] <- Prob/sum(Prob)
}
}
SDP_matrix
})
SDP_Mat
}
#' Integrate against uniform distributions of measurement and implementation uncertainty
#'
#' @export
int_f <- function(f, x, q, sigma_m, sigma_i, pars){
K <- pars[2]
sigma_m <- K*sigma_m
sigma_i <- K*sigma_i # scale noise into units of K
if(sigma_m > 0 && sigma_i > 0){
g <- function(X) f(X[1], X[2], pars)
lower <- c(max(x - sigma_m, 0), max(q - sigma_i, 0))
upper <- c(x + sigma_m, q + sigma_i)
A <- adaptIntegrate(g, lower, upper)
out <- A$integral/((q+sigma_i-max(q-sigma_i, 0))*(x+sigma_m-max(x-sigma_m, 0)))
} else if(sigma_m == 0 && sigma_i > 0){
g <- function(h) f(x, h, pars)
lower <- max(q - sigma_i, 0)
upper <- q + sigma_i
A <- adaptIntegrate(g, lower, upper)
out <- A$integral/(q+sigma_i-max(q-sigma_i, 0))
} else if(sigma_i == 0 && sigma_m > 0){
g <- function(y) f(y, q, pars)
lower <- max(x - sigma_m, 0)
upper <- x + sigma_m
A <- adaptIntegrate(g, lower, upper)
out <- A$integral/(x+sigma_m-max(x-sigma_m, 0))
} else if (m == 0 && n == 0){
out <- f(x,q,pars)
} else {
stop("distribution widths cannot be negative")
}
out
}
#' Analytic solution to int_f for logistic model
#' @export
F_integral <- function(x,q, m, n, pars){
K <- pars[2]
m <- K*m
n <- K*n # scale noise by K
if(m > 0 && n > 0){
out <- ((q+n-max(0,q-n))*(x+m-max(0,x-m))*(6*x*K-6*q*K-6*n*K+6*m*K+6*max(0,x-m)*K-6*
max(0,q-n)*K-2*x^2+3*q*x+3*n*x-4*m*x-2*max(0,x-m)*x+3*max(0,q-n)*x-2*q^2-4*n*q+3*m*q+3*
max(0,x-m)*q-2*max(0,q-n)*q-2*n^2+3*m*n+3*max(0,x-m)*n-2*max(0,q-n)*n-2*m^2-2*max(0,x-m)*m+3*
max(0,q-n)*m-2*max(0,x-m)^2+3*max(0,q-n)*max(0,x-m)-2*max(0,q-n)^2))/(6*K)/((q+n-max(q-n, 0))*(x+m-max(x-m, 0)))
} else if(m == 0 && n > 0) {
y <- x
out <- (((6*q+6*n-6*max(0,q-n))*y-3*q^2-6*n*q-3*n^2+3*max(0,q-n)^2)*K+(-3*q-3*n+3*max(0,q-n))*
y^2+(3*q^2+6*n*q+3*n^2-3*max(0,q-n)^2)*y-q^3-3*n*q^2-3*n^2*q-n^3+max(0,q-n)^3)/(3*K*(q+n-max(q-n, 0)))
} else if(n == 0 && m > 0){
h <- q
out <- ((3*x^2+(6*m-6*h)*x+3*m^2-6*h*m+6*max(0,x-m)*h-3*max(0,x-m)^2)*K-x^3+(3*h-3*m)*x^2+
(-3*m^2+6*h*m-3*h^2)*x-m^3+3*h*m^2-3*h^2*m+3*max(0,x-m)*h^2-3*max(0,x-m)^2*h+max(0,x-m)^3)/(3*K*(x+m-max(x-m, 0)))
} else if (m == 0 && n == 0){
S <- max(x - q, 0)
out <- S * (1 - S/K) + S
} else {
stop("distribution widths cannot be negative")
}
max(out,0)
}
|
49e7924e5bcc155cac2865e0bad960fcc4aa6b29
|
e646416a1bbc302f73d2fdcbe78c5a8069e40fc8
|
/fvoi/env_functions.R
|
64a9d7feee3fd10cd799a0451c11a78ca3ef7e76
|
[
"MIT"
] |
permissive
|
jusinowicz/info_theory_eco
|
c0ef0c0f94eca2df3b7308098f05b72233261c43
|
b0770b10464732aa32d13f46ba3c5ef958a74dcc
|
refs/heads/master
| 2022-05-28T19:34:50.642858
| 2022-05-05T17:37:19
| 2022-05-05T17:37:19
| 140,295,569
| 2
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 26,908
|
r
|
env_functions.R
|
#=============================================================================
# Functions to go with simple_fvoi
# These work from the more classic setup of betting on on horse races
# and build from there. In the classic ecological example of desert annuals,
# the currency is in seeds, which a population uses to bet on environmental
# states. The payoff is in terms of new seeds (offspring).
#
# horses = environmental states. When a horse wins, it is equivalent to
# a particular environment manifesting itself.
#
# bet = proportion of population invested in an environmental state. For
# example, the number of seeds that germinate.
#
# payout = per-capita growth rate. For example, the number of new offspring
# (i.e. seeds) produced by germinating individuals.
#
#=============================================================================
#=============================================================================
# Environment:
#=============================================================================
#=============================================================================
# Generate the probabilities for a binomial distribution for a number of
# environmental states given by num_states.
#
# num_states Number of discrete environmental states
#=============================================================================
make_env_states = function(num_states=10) {
counts = rbinom(num_states,10, 0.5)
probs = counts/sum(counts)
return(as.matrix(probs) )
}
#=============================================================================
# Generate a time series where each state has a chance of occurring (i.e.
# winning) based on generating the max value.
#
# num_states Number of discrete environmental states
#=============================================================================
make_simple_env = function(env_states, ngens = 1000) {
env_states = as.matrix(env_states)
num_states = dim(env_states)[1]
es_fact = factor(1:num_states)
#Make the temporary environment
env_tmp = matrix(0,ngens,num_states)
#And this is the final environmental sequence
env = matrix(0,ngens,1)
#Fill each time step from a binomial distribution
for(n in 1:ngens){ env_tmp[n,] = apply(env_states, 1, function(x) rbinom(1,100,x) ) }
#Find the winning state
env = apply(env_tmp,1, which.max )
env = factor(env,level=es_fact)
return((env) )
}
#=============================================================================
# Species:
#=============================================================================
#=============================================================================
#
#=============================================================================
get_species_fraction = function(probs, gcor, gc = 0.5, method = "variable" ) {
if (method == "variable") {
#This is standard code for generating correlated random sequences
corm = matrix(gcor, nrow = 2, ncol = 2)
diag(corm) = 1
corm = chol(corm)
X2 = runif(length(probs))
X = cbind(probs,X2)
# induce correlation (does not change X1)
new_fraction = X %*% corm
#Just take column 2 and renormalize to 1
new_fraction = new_fraction[,2]/sum(new_fraction[,2])
return( as.matrix( new_fraction) )
} else if(method == "constant"){
return(new_fraction = matrix(gc, length(probs),1))
}
}
#=============================================================================
#
#=============================================================================
get_species_fit = function(probs, fcor, fm, method = "variable" ) {
if (method == "variable") {
#This is standard code for generating correlated random sequences
corm = matrix(fcor, nrow = 2, ncol = 2)
diag(corm) = 1
corm = chol(corm)
X2 = runif(length(probs))
X = cbind(probs,X2)
# induce correlation (does not change X1)
new_fraction = X %*% corm
return( (new_fraction[,2]*fm) )
}else if(method == "constant"){
return(new_fraction = matrix(fm, length(probs),1))
}
}
#=============================================================================
# Generate a species fitness distribution that is not correlated with the
# distribution of environmental states.
# Use the Poisson distribution, centered on state "mstate", and distributed
# between the min/max environmental state values.
#=============================================================================
get_species_fit_pois = function(mstates, num_states, nspp,fm ) {
nsamps = 1e4
fr_states = matrix(0, nsamps, nspp)
new_fraction = matrix(0,num_states,nspp)
for(s in 1:nspp){
fr_states[,s] = rpois(nsamps,mstates)
#renormalize over interval 0, max num_states
b= num_states-1;a = 0
fr_states[,s] = (b-a)*(fr_states[,s]-min(fr_states[,s]))/
(max(fr_states[,s])-min(fr_states[,s])) +
a
new_fraction[,s] = hist(fr_states[,s],breaks = 0:(num_states) )$counts
new_fraction[,s] = fm[s]* new_fraction[,s]/(max(new_fraction[,s]))
}
return(new_fraction)
# env_states = hist(env_states,0:(num_states))$counts
}
#=============================================================================
#
#=============================================================================
get_fit_one = function(env_states, fs ){
num_states = length(env_states)
nspp =dim(fs)[2]
#Simulate the environment:
env_current = sample(x=(0:(num_states-1)), size=1, prob =env_states, replace=T)
ec = max(env_current)
env_act = ec# which.max(env_current)
#Identify species' payoff:
sp_fit = matrix((0:(num_states-1)),num_states,nspp)
sp_fit[sp_fit!=ec] = -1 #Identify losers
sp_fit[sp_fit==ec] = fs[sp_fit==ec] #Set winning state to its payout
sp_fit[sp_fit<0] = 0
fs_env = list( env_act=env_act, sp_fit=sp_fit)
return(fs_env)
}
#=============================================================================
#get_cp returns the conditional betting proportions of a win based on
# having information: b(w|i). Ecologically, this is the "bet" (e.g.
# germination) on an environment based on a cue: g(e|c).
# This function decides the spread of error in information with
# the variable acc = [0:1]. When acc = 1, information is perfect and
# there is no spread. When acc = 0 there is no information and all
# outcomes are equally likely (i.e. uniform). For values in between,
# error is generated with exponential decay from the target or true
# value with more spread as acc -> 0.
# acc needs one entry per species
#=============================================================================
get_cp = function(env_states, acc){
tol = 1e-3
num_states = length(env_states)
nspp =length(acc)
cp_out = array( matrix(0,num_states,num_states), dim = c(num_states,num_states,nspp) )
xx0=matrix((0:num_states))
for( s in 1:nspp){
#Make an exponential dispersal kernel to model how probability of
#error in the conditional probability decays with distance from the
#env state that matches the cue. With perfect match between cue and
#environment (acc =1 ) then there is a single value where e = c.
#With no informative cue, this gives a uniform distribution by making
#a_rr really small (giving kd a large variance).
kd=xx0
a_rr = acc[s]
if(a_rr == 0 ){a_rr = tol}
kd = a_rr/2*exp(-a_rr*abs(xx0))
kd=kd/(sum(kd))
for (n in 1:num_states){
cp_tmp = matrix(0,num_states,1)
cp_er = 1- acc[s] #This is the error, the cp of getting the wrong env
ll = (num_states+1) - (n) #Distance from the left
lr = n #Distance from the right
#Get the right side of the kernel
cp_tmp[(n+1):num_states] = cp_er/2*kd[2:ll ]
#Get the left side of the kernel
cp_tmp[1:(n-1)] = cp_er/2 * kd[2:lr][(lr-1):1]
#This is the conditional probability of the match
cp_tmp[n] = acc[s]
if(a_rr == tol ){cp_tmp[n] = mean(cp_tmp); cp_tmp = cp_tmp/sum(cp_tmp) }
cp_out[,n,s] = cp_tmp[1:num_states]
}
}
return(cp_out)
}
#=============================================================================
#Numerically solve optimal germination strategies for the single-species,
#dormancy model:
# Ni[t+1] = Ni[t]( (1-g_i)*s_i + g_i * f_i )
#
# Ni The population vectors (matrix) from the main code
# env The vector of environmental states, length must match dim[1]
# of Ni.
# sr Species survival rates, size needs to match dim[2] of Ni.
# gw An optional weight on the germination rate. This is used to
# get the multi-strategy optimum with get_multi_opt
#=============================================================================
get_single_opt= function ( fr, nspp, sr, gw =NULL, incr=0.01) {
ngens = dim(fr)[1]
#fr = as.matrix(fr)
nspp = dim(fr)[2]
if(is.null(gw)) {gw = c(matrix(1,nspp,1))}
env_fit = NULL
env_fit$sr =sr
env_fit$fr = fr
#Germination fraction, in sequence. The endpoints 0 and 1 are special cases
#which can be avoided.
H1 = seq(0.01,.99,incr) #Germination fraction.
Hc = c(matrix("H1",nspp,1) )
#Combinations are independent for singl-species model
Hs_big = cbind(H1,H1)
#Hs_big= eval(parse(text=paste("expand.grid(", paste(unlist(Hc),collapse=","), ")" )))
#For the average growth rate, rho
env_fit$rho1 = array(1, dim = c(ngens+1, nspp, dim(Hs_big)[1] ) ) #Model 1
#Make the population time series match rho variables:
env_fit$Nj1 = array(0.1, dim = c(ngens+1, nspp, dim(Hs_big)[1] ) )
#Average of log rho
env_fit$m1 = matrix (0, dim(Hs_big)[1],nspp)
#The probability distribution of rho:
breaks = 15
env_fit$pr1 = array(0, dim = c(breaks-1, nspp, dim(Hs_big)[1] ) )
#The breaks, which correspond to the rhos/lambdas.
env_fit$br1 = array(0, dim = c(breaks-1, nspp, dim(Hs_big)[1] ) )
for(h in 1:dim(Hs_big)[1]) {
Hs = as.matrix(unlist(Hs_big[h,]))
#=============================================================================
#Population dynamics
#=============================================================================
for (n in 1:ngens){
#Model 3:
env_fit$rho1[n,,h ] = ( ( env_fit$sr*(1- gw*Hs) ) +
env_fit$fr[n,] * gw*Hs) #/(env_fit$fr[n,]*Hs * env_fit$Nj3[n,,h]) )
env_fit$Nj1[n+1,,h ] = env_fit$Nj1[n,,h ] * env_fit$rho1[n,,h ]
}
#=============================================================================
#Get the optimum
#=============================================================================
env_fit$rho1[,,h] =log(env_fit$rho1[,,h])
env_fit$rho1[,,h][!is.finite(env_fit$rho1[,,h] )] = NA
for (s in 1:nspp) {
#Probability distribution of growth rates
b_use = seq(min(env_fit$rho1[,s,h],na.rm=T),max(env_fit$rho1[,s,h],na.rm=T), length.out=breaks)
rho_dist = hist(env_fit$rho1[,s,h],breaks=b_use,plot = FALSE)
env_fit$pr1[,s,h] = rho_dist$counts/sum(rho_dist$counts)
env_fit$br1[,s,h] = rho_dist$mids
#Average log growth rate:
env_fit$m1[h,s] = sum(env_fit$pr1[,s,h]*(env_fit$br1[,s,h] ) )
}
}
#Which is the max value of the log growth rate in each column?
opts=NULL
opts$opts = Hs_big[ apply(env_fit$m1, 2 ,which.max) ]
opts$gr = env_fit$m1[ apply(env_fit$m1, 2 ,which.max) ]
return(opts)
}
#=============================================================================
#Numerically solve optimal germination strategies for single-species
#dormancy model when there are multiple germination strategies. This just
#applies the single :
# Ni[t+1] = Ni[t]( (1-g_i)*s_i + g_i * f_i )
#
# Ni The population vectors (matrix) from the main code
# env The vector of environmental states, length must match dim[1]
# of Ni.
# sr Species survival rates, size needs to match dim[2] of Ni.
#=============================================================================
get_multi_opt= function ( fr, gs, sr, incr=0.01) {
ngens = dim(fr)[1]
#fr = as.matrix(fr)
num_states = dim(gs)[1]
nspp = dim(gs)[2]
env_fit = NULL
env_fit$sr =sr
env_fit$fr = fr
gs_io = matrix(0, num_states,nspp) #Optimal germination rates.
grs = matrix(0, num_states,nspp) #Growth rate of optimum.
for(g in 1:num_states){
print( paste("State number:", g) )
gout = get_single_opt( fr, nspp, sr, gw = gs[g,], incr=0.01)
gs_io[g,] = gout$opts
grs[g,] = gout$gr
}
gs_out= list(gs_io = gs_io, grs=grs)
return(gs_out)
}
#=============================================================================
#
#=============================================================================
#=============================================================================
#IGNORE THIS ONE FOR NOW -- This corresponds to the bad file
#Numerically solve optimal germination strategies for the single-species,
#dormancy model:
# Ni[t+1] = Ni[t]( (1-g_i)*s_i + g_i * f_i )
#
# Ni The population vectors (matrix) from the main code
# env The vector of environmental states, length must match dim[1]
# of Ni.
# sr Species survival rates, size needs to match dim[2] of Ni.
#=============================================================================
# get_single_opt_bad = function ( env, nspp, sr, incr=0.05) {
# ngens = dim(env)[1]
# env = as.matrix(env)
# env_fit = NULL
# env_fit$sr =sr
# env_fit$fr = env
# #Germination fraction, in sequence. The endpoints 0 and 1 are special cases
# #which can be avoided.
# H1 = seq(0.01,.99,incr) #Germination fraction.
# Hc = c(matrix("H1",nspp,1) )
# #Combinations are independent for singl-species model
# Hs_big = cbind(H1,H1)
# #Hs_big= eval(parse(text=paste("expand.grid(", paste(unlist(Hc),collapse=","), ")" )))
# #For the average growth rate, rho
# env_fit$rho1 = array(1, dim = c(ngens+1, nspp, dim(Hs_big)[1] ) ) #Model 1
# #Make the population time series match rho variables:
# env_fit$Nj1 = array(0.1, dim = c(ngens+1, nspp, dim(Hs_big)[1] ) )
# #Average of log rho
# env_fit$m1 = matrix (0, dim(Hs_big)[1],nspp)
# #The probability distribution of rho:
# breaks = 15
# env_fit$pr1 = array(0, dim = c(breaks-1, nspp, dim(Hs_big)[1] ) )
# #The breaks, which correspond to the rhos/lambdas.
# env_fit$br1 = array(0, dim = c(breaks-1, nspp, dim(Hs_big)[1] ) )
# for(h in 1:dim(Hs_big)[1]) {
# Hs = as.matrix(unlist(Hs_big[h,]))
# #=============================================================================
# #Population dynamics
# #=============================================================================
# for (n in 1:ngens){
# #Model 3:
# env_fit$rho1[n,,h ] = ( ( env_fit$sr*(1- Hs) ) +
# env_fit$fr[n,] * Hs) #/(env_fit$fr[n,]*Hs * env_fit$Nj3[n,,h]) )
# env_fit$Nj1[n+1,,h ] = env_fit$Nj1[n,,h ] * env_fit$rho1[n,,h ]
# }
# #=============================================================================
# #Get the optimum
# #=============================================================================
# env_fit$rho1[,,h] =log(env_fit$rho1[,,h])
# env_fit$rho1[,,h][!is.finite(env_fit$rho1[,,h] )] = NA
# for (s in 1:nspp) {
# #Probability distribution of growth rates
# b_use = seq(min(env_fit$rho1[,s,h],na.rm=T),max(env_fit$rho1[,s,h],na.rm=T), length.out=breaks)
# rho_dist = hist(env_fit$rho1[,s,h],breaks=b_use,plot = FALSE)
# env_fit$pr1[,s,h] = rho_dist$counts/sum(rho_dist$counts)
# env_fit$br1[,s,h] = rho_dist$mids
# #Average log growth rate:
# env_fit$m1[h,s] = sum(env_fit$pr1[,s,h]*(env_fit$br1[,s,h] ) )
# }
# }
# #Which is the max value of the log growth rate in each column?
# opts = Hs_big[ apply(env_fit$m1, 2 ,which.max) ]
# return(opts)
# }
#=============================================================================
# Functions to go with lott_info and lott_info_inv.
#
# Making species fitness
# Making species germination (cue)
# Making environment
#=============================================================================
#=============================================================================
# Ennvironment:
# 1. runif1 random, uniform interval
# 2. rnorm1 random, Gaussian variance
# 3. urand_each, this considers the optimum of each species' environement
# nrand_each and attempts to create an environmental time series with
# mode for each species. This requires the additonal
# "mweights" to specify the relative frequency of each mode
# mweights weighting for rand_each
#=============================================================================
get_env = function (env_fit, method = "runif1" ){
nspp = dim(env_fit$Ni)[2]
ngens = dim(env_fit$Ni)[1]
if( method == "runif1") {
min1 = 0
max1 = 1
if(!is.null(env_fit$min_max) ) {
min1 = min(env_fit$min_max)
max1 = max(env_fit$min_max)
}
env_fit$env = runif(ngens, min = min1, max=max1 )
}
if( method == "rnorm1") {
m_use = mean(env_fit$opt)
v_use = max(env_fit$var)
if(!is.null(env_fit$g_mean)) {m_use = env_fit$g_mean}
if(!is.null(env_fit$g_var)) {v_use = env_fit$g_var}
env_fit$env = rnorm(ngens, m_use, v_use )
}
if( method == "urand_each") {
env_tmp = NULL
for(s in 1:nspp) {
min1 = 0
max1 = 1
weights = (1/nspp)
if(!is.null(env_fit$min_max) ) {
min1 = min(env_fit$min_max[s,])
max1 = max(env_fit$min_max[s,])
}
if(!is.null(env_fit$weights) ) { weights = env_fit$weights[s]}
env_tmp = c(env_tmp, runif(ngens*weights, min=min1, max=max1) )
}
lc = ngens - length(env_tmp)
if(lc > 0 ) {env_tmp = c(env_tmp,matrix(0,mean(env_tmp),1 ) ) }
if(lc < 0 ) {env_tmp = env_tmp[-(1:lc)] }
}
if( method == "nrand_each") {
env_tmp = NULL
for(s in 1:nspp) {
weights = (1/nspp)
m_use = mean(env_fit$opt)
v_use = max(env_fit$var)
if(!is.null(env_fit$g_mean)) { m_use = env_fit$g_mean[s]}
if(!is.null(env_fit$g_var)) {v_use = env_fit$g_var[s]}
if(!is.null(env_fit$weights) ) {weights = env_fit$weights[s]}
env_tmp = c(env_tmp, rnorm(ngens*weights, m_use, v_use ) )
}
lc = ngens - length(env_tmp)
if(lc > 0 ) {env_tmp = c(env_tmp,matrix(mean(env_tmp),abs(lc),1) ) }
if(lc < 0 ) {env_tmp = env_tmp[-(1:lc)] }
}
#Add in environments that are bad to both species
if( method == "nrand_each_bad") {
env_tmp = NULL
for(s in 1:nspp) {
weights = (1/nspp)*0.5
m_use = mean(env_fit$opt)
v_use = max(env_fit$var)
if(!is.null(env_fit$g_mean)) { m_use = env_fit$g_mean[s]}
if(!is.null(env_fit$g_var)) {v_use = env_fit$g_var[s]}
if(!is.null(env_fit$weights) ) {weights = env_fit$weights[s]}
env_tmp = c(env_tmp, rnorm(ngens*weights, m_use, v_use ) )
}
# m_use = env_fit$g_mean - c(0.1, -0.1)
min1 = min(env_tmp)
max1 = max(env_tmp)
for(s in 1:2) {
weights = (1/nspp)*0.5
# v_use = max(env_fit$var)
# env_tmp = c(env_tmp, rnorm(ngens*weights, m_use[s], v_use ) )
env_tmp = c(env_tmp, runif(ngens*weights, min=min1, max=max1) )
}
lc = ngens - length(env_tmp)
if(lc > 0 ) {env_tmp = c(env_tmp,matrix(mean(env_tmp),abs(lc),1) ) }
if(lc < 0 ) {env_tmp = env_tmp[-(1:lc)] }
}
return(sample(env_tmp) )
}
#=============================================================================
# get_fitness
# Simulates species intrinsic (i.e. in the absence of competition)
# reproduction rates according to an underlying environmental distribution,
# and an assumption about the distributional shape of species response:
#
# Fitness:
# 1. no_var species have a single environmental value
# 2. uni_var variance around an optimum that is uniform (runif)
# 3. norm_var Gaussian around the optimum
#
#=============================================================================
get_fitness = function (env_fit) {
nspp = dim(env_fit$Ni)[2]
ngens = dim(env_fit$Ni)[1]
fit_tmp = env_fit$Ni
for (s in 1:nspp) {
if( env_fit$method == "nrand_each" | env_fit$method == "rnorm1" | env_fit$method == "nrand_each_bad" ) {
m_use = mean(env_fit$opt)
v_use = max(env_fit$var)
if(!is.null(env_fit$g_mean)) {m_use = env_fit$g_mean[s]}
if(!is.null(env_fit$g_var)) {v_use = env_fit$g_var[s]}
fit_tmp[,s] = exp(-0.5* ( (env_fit$env-m_use)/(v_use) )^2 )
}
if( env_fit$method == "urand_each" | env_fit$method == "runif" ) {
min1 = 0
max1 = 1
if(!is.null(env_fit$min_max) ) {
min1 = min(env_fit$min_max[s,])
max1 = max(env_fit$min_max[s,])
}
fit_tmp[,s] = 1* as.numeric( (env_fit$env) >= min1 & (env_fit$env) <= max1 )
}
#Standardize on the interval 0,1
fit_tmp[,s] = (fit_tmp[,s]- min(fit_tmp[,s]))/( max(fit_tmp[,s]) - min(fit_tmp[,s]) )
}
return(fit_tmp)
}
#=============================================================================
# Germination:
# 1. g_corr define germination cue relative to fitness using a
# correlation coefficient. g_corr = 1 is perfect prediction ,
# 0 is no correlation, negative values would be harmful
# 2. g_always always germinate a fraction of seeds.
# 3. in progress
#=============================================================================
get_env_cue = function (env_fit, method = "g_corr" ){
nspp = dim(env_fit$Ni)[2]
ngens = dim(env_fit$Ni)[1]
if( method == "g_corr") {
cue_tmp = env_fit$Ni
for(s in 1:nspp) {
cuse = env_fit$g_corr[s]
#This method will make a second vector for each species that
#is correlated to the environmental response.
ct = cbind(env_fit$fr[,s], runif(ngens) )
cor1 = cor(ct)
#1. make independent matrixes
chol1 = solve(chol(cor1))
ct_new = ct %*% chol1 #Make new independent matrix
#2. apply new correlation
cor_use = matrix( c(1, cuse,cuse,1),2,2 )
chol2 = chol(cor_use) #Factor this
ct_use = ct_new %*% chol2
#3. standardize on the interval 0.001, 0.999
ct_use[,2] = (0.999 - 0.001)*(ct_use[,2]- min(ct_use[,2]))/( max(ct_use[,2]) - min(ct_use[,2]) )+0.001
cue_tmp[,s] = ct_use[,2]
}
}
return(cue_tmp)
}
#=============================================================================
# Versions of the above functions written for the comp exclusion/niche sims
#=============================================================================
#=============================================================================
# Ennvironment:
# 1. runif1 random, uniform interval
# 2. rnorm1 random, Gaussian variance
# 3. urand_each, this considers the optimum of each species' environement
# nrand_each and attempts to create an environmental time series with
# mode for each species. This requires the additonal
# "mweights" to specify the relative frequency of each mode
# mweights weighting for rand_each
#=============================================================================
get_env2 = function (Ni, min_max =NULL, opt=NULL, var=NULL, g_mean =NULL, g_var = NULL,
weights =NULL, method = "runif1" ){
nspp = dim(Ni)[2]
ngens = dim(Ni)[1]
if( method == "runif1") {
min1 = 0
max1 = 1
if(!is.null(min_max) ) {
min1 = min(min_max)
max1 = max(min_max)
}
env = runif(ngens, min = min1, max=max1 )
return(env)
}
if( method == "rnorm1") {
m_use = mean(opt)
v_use = max(var)
if(!is.null(g_mean)) {m_use = g_mean}
if(!is.null(g_var)) {v_use = g_var}
env = rnorm(ngens, m_use, v_use )
return(env)
}
if( method == "urand_each") {
env_tmp = NULL
for(s in 1:nspp) {
min1 = 0
max1 = 1
weights = (1/nspp)
if(!is.null(min_max) ) {
min1 = min(min_max[s,])
max1 = max(min_max[s,])
}
if(!is.null(weights) ) { weights = weights[s]}
env_tmp = c(env_tmp, runif(ngens*weights, min=min1, max=max1) )
}
lc = ngens - length(env_tmp)
if(lc > 0 ) {env_tmp = c(env_tmp,matrix(0,mean(env_tmp),1 ) ) }
if(lc < 0 ) {env_tmp = env_tmp[-(1:lc)] }
return(sample(env_tmp))
}
if( method == "nrand_each") {
env_tmp = NULL
for(s in 1:nspp) {
weights = c(matrix( (1/nspp),nspp,1))
m_use = mean(opt)
v_use = max(var)
if(!is.null(g_mean)) { m_use = g_mean[s]}
if(!is.null(g_var)) {v_use = g_var[s]}
if(!is.null(weights) ) {weights = weights[s]}
env_tmp = c(env_tmp, rnorm(ngens*weights, m_use, v_use ) )
}
lc = ngens - length(env_tmp)
if(lc > 0 ) {env_tmp = c(env_tmp,matrix(mean(env_tmp),abs(lc),1) ) }
if(lc < 0 ) {env_tmp = env_tmp[-(1:lc)] }
return(sample(env_tmp) )
}
}
#=============================================================================
# get_fitness
# Simulates species intrinsic (i.e. in the absence of competition)
# reproduction rates according to an underlying environmental distribution,
# and an assumption about the distributional shape of species response:
#
# Fitness:
# 1. no_var species have a single environmental value
# 2. uni_var variance around an optimum that is uniform (runif)
# 3. norm_var Gaussian around the optimum
#
#=============================================================================
get_fitness2 = function (Ni,env,opt=NULL, var=NULL, g_mean=NULL,g_var=NULL,
min_max=NULL, method =NULL) {
nspp = dim(Ni)[2]
ngens = dim(Ni)[1]
fit_tmp = Ni
for (s in 1:nspp) {
if( method == "nrand_each" | method == "rnorm1" ) {
m_use = mean(opt)
v_use = max(var)
if(!is.null(g_mean)) {m_use = g_mean[s]}
if(!is.null(g_var)) {v_use = g_var[s]}
fit_tmp[,s] = exp(-0.5* ( (env-m_use)/(v_use) )^2 )
}
if( method == "urand_each" | method == "runif" ) {
min1 = 0
max1 = 1
if(!is.null(min_max) ) {
min1 = min(min_max[s,])
max1 = max(min_max[s,])
}
fit_tmp[,s] = 1* as.numeric( (env) >= min1 & (env) <= max1 )
}
#Standardize on the interval 0,1
fit_tmp[,s] = (fit_tmp[,s]- min(fit_tmp[,s]))/( max(fit_tmp[,s]) - min(fit_tmp[,s]) )
}
return(fit_tmp)
}
#=============================================================================
# Germination:
# 1. g_corr define germination cue relative to fitness using a
# correlation coefficient. g_corr = 1 is perfect prediction ,
# 0 is no correlation, negative values would be harmful
# 2. g_always always germinate a fraction of seeds.
# 3. in progress
#=============================================================================
get_env_cue2 = function (Ni, fr, g_corr=NULL, method = "g_corr" ){
nspp = dim(Ni)[2]
ngens = dim(Ni)[1]
if( method == "g_corr") {
cue_tmp = Ni
for(s in 1:nspp) {
cuse = g_corr[s]
#This method will make a second vector for each species that
#is correlated to the environmental response.
ct = cbind(fr[,s], runif(ngens) )
cor1 = cor(ct)
#1. make independent matrixes
chol1 = solve(chol(cor1))
ct_new = ct %*% chol1 #Make new independent matrix
#2. apply new correlation
cor_use = matrix( c(1, cuse,cuse,1),2,2 )
chol2 = chol(cor_use) #Factor this
ct_use = ct_new %*% chol2
#3. standardize on the interval 0.001, 0.999
ct_use[,2] = (0.999 - 0.001)*(ct_use[,2]- min(ct_use[,2]))/( max(ct_use[,2]) - min(ct_use[,2]) )+0.001
cue_tmp[,s] = ct_use[,2]
}
}
return(cue_tmp)
}
|
fd3eb9dbb2fcd7392372147e5a6af06812b64c9c
|
a3d6851eb5726abe6e32bc9876ce9648d2f6b5ad
|
/examples/_defunct/MCDA/exp_test/rscripts/test_ElectreIII_filePY.R
|
86bf0e40a3da2a1bbf0171e07e467ec43fa78fa3
|
[
"MIT"
] |
permissive
|
acsicuib/YAFS
|
7ebedbddcf66e5d4ae02800b7d74dac719a54861
|
5a48b7ca6d5293a3d371a5992e4250116bf1b11c
|
refs/heads/YAFS3
| 2023-04-27T19:26:36.964584
| 2023-04-17T06:59:02
| 2023-04-17T06:59:02
| 123,104,686
| 90
| 67
|
MIT
| 2023-04-17T06:59:04
| 2018-02-27T09:23:01
|
Python
|
UTF-8
|
R
| false
| false
| 5,899
|
r
|
test_ElectreIII_filePY.R
|
options(warn=-1)
library(OutrankingTools)
#dev.off()
args1= "/Users/isaaclera/PycharmProjects/YAFS/src/examples/MCDA/exp_test/data"
args2= "/data"
pathIN <- paste(args1,args2,".csv",sep="")
colClasses <- c("NULL",rep("numeric", count.fields(pathIN, sep=",")[1] -1))
performanceTable <- read.table(file=pathIN, header=F, sep=",",colClasses=colClasses,skip=1)
#In this example we will use a linear threshold format. Thus we need to define two columns
#of numeric values for each threshold, one for the slope (label beginning by alpha in the figure
#below) and another one for the interception (label beginning by beta) as shown below:
# Vector containing names of alternatives
alternatives <- rownames(performanceTable)
# Vector containing names of criteria
criteria <- colnames(performanceTable)
# vector indicating the direction of the criteria evaluation .
minmaxcriteria <-c("min","min","min")
# criteriaWeights vector
#criteriaWeights <- c(0.3,0.1,0.3,0.2,0.1,0.2,0.1)
criteriaWeights <- c(0.33,0.33,0.33)
# thresholds vector
# alpha_q <- c(0.08,0.02,0,0,0.1,0,0)
# beta_q <- c(-2000,0,1,100,-0.5,0,3)
#
# alpha_p <- c(0.13,0.05,0,0,0.2,0,0)
# beta_p <- c(-3000,0,2,200,-1,5,5)
#
# alpha_v <- c(0.9,NA,0,NA,0.5,0,0)
# beta_v <- c(50000,NA,4,NA,3,15,15)
# Indifference
alpha_q <- c(0,0,0)
beta_q <- c(0,0,0)
# Preference
alpha_p <- c(0.3,0.2,0.2)
beta_p <- c(4,6,6)
#Veto
alpha_v <- c(NA,NA,0.3)
beta_v <- c(NA,NA,30)
# Vector containing the mode of definition which
# indicates the mode of calculation of the thresholds.
# mode_def <- c("I","D","D","D","D","D","D")
mode_def <- c("D","D","D")
# Testing
Electre3_AlphaBetaThresholds(performanceTable,
alternatives,
criteria,
minmaxcriteria,
criteriaWeights,
alpha_q,
beta_q,
alpha_p,
beta_p,
alpha_v,
beta_v,
mode_def)
args1= "/Users/isaaclera/PycharmProjects/YAFS/src/examples/MCDA/exp_test/data"
args2= "/data"
pathIN <- paste(args1,args2,".csv",sep="")
colClasses <- c("NULL",rep("numeric", count.fields(pathIN, sep=",")[1] -2))
performanceTable <- read.table(file=pathIN, header=F, sep=",",colClasses=colClasses,skip=1)
print("2 parte")
IndifferenceThresholds <- c(0,9)
PreferenceThresholds <- c(10,16)
VetoThresholds <- c(NA,NA)
criteriaWeights <- c(1,1)
criteria <- colnames(performanceTable)
minmaxcriteria <-c("min","max")
# Vector containing the mode of definition which
# indicates the mode of calculation of the thresholds.
# Testing
Electre3_SimpleThresholds(performanceTable,
alternatives,
criteria,
minmaxcriteria,
criteriaWeights,
IndifferenceThresholds,
PreferenceThresholds,
VetoThresholds)
performanceMatrix <- cbind(
c(-14,129,-10,44,-14,-20),
c(90,100,50,90,100,10),
c(0,0,100,0,0,0),
c(40,100,10,5,20,30),
c(100,100,100,20,40,30)
)
args1= "/Users/isaaclera/PycharmProjects/YAFS/src/examples/MCDA/exp_test/data"
args2= "/data"
pathIN <- paste(args1,args2,".csv",sep="")
colClasses <- c("NULL",rep("numeric", count.fields(pathIN, sep=",")[1] -1))
performanceMatrix <- read.table(file=pathIN, header=F, sep=",",colClasses=colClasses,skip=1)
performanceMatrix <- cbind(
c(2,7,8,13,16),
c(20,16,23,3,10)
)
alternatives <- c("Project1","Project2","Project3","Project4","Project5")
# Vector containing names of criteria
criteria <- c( "R","W")
# vector indicating the direction of the criteria evaluation
minmaxcriteria <- c("min","min")
# criteriaWeights vector
# thresholds vector
IndifferenceThresholds <- c(1,5)
PreferenceThresholds <- c(4,15)
VetoThresholds <- c(15,30)
criteriaWeights <- c(1,1)
out <- Electre3_SimpleThresholds(performanceMatrix,
alternatives,
criteria,
minmaxcriteria,
criteriaWeights,
IndifferenceThresholds,
PreferenceThresholds,
VetoThresholds)
# df <- data.frame(out['Final Ranking Matrix'])
# print(df["Final.Ranking.Matrix.alternative"])
#
# PARTE 4 probando con valores de la simulación
#
args3 = "4,1,2,3,1"
args4 = "1.00000,99.93333,174.00000,820.00000,0.00000"
args5 = "4.0,358.8,557.0,4220.0,20.0"
args6 = "4.8,535.2,751.9200000000001,8324.0,22"
args6 = "NA,NA,NA,NA,NA"
args7 = "min,min,min,min,max"
args1= "/Users/isaaclera/PycharmProjects/YAFS/src/examples/MCDA/exp_test/data"
args2= "/data_0"
pathIN <- paste(args1,args2,".csv",sep="")
pathOUT <- paste(args1,args2,"_r.csv",sep="")
colClasses <- c("NULL",rep("numeric", count.fields(pathIN, sep=",")[1] -1))
performanceMatrix <- read.table(file=pathIN, header=F, sep=",",colClasses=colClasses,skip=1)
alternatives <- rownames(performanceMatrix)
criteria <- colnames(performanceMatrix)
criteriaWeights <- as.numeric(unlist(strsplit(args3, ",")))
IndifferenceThresholds <- as.numeric(unlist(strsplit(args4, ",")))
PreferenceThresholds <- as.numeric(unlist(strsplit(args5, ",")))
VetoThresholds <- as.numeric(unlist(strsplit(args6, ",")))
minmaxcriteria <- c(unlist(strsplit(args7, ",")))
out <- Electre3_SimpleThresholds(performanceMatrix,
alternatives,
criteria,
minmaxcriteria,
criteriaWeights,
IndifferenceThresholds,
PreferenceThresholds,
VetoThresholds)
|
ddb146cbdf199f90eb268305fbc663d08f3b2607
|
248a4d7053bfbc63f0bdd95fe144a597e96c650b
|
/R/datasets.R
|
4bf7a681a187e2e87b8d04666077494a262c884b
|
[
"MIT"
] |
permissive
|
irhoppe/blastr
|
275ba3a2325be30a48cf2146197655a3fe58b59f
|
e0ea444c3c7dcbc4937e19d5851ead98fab5520e
|
refs/heads/main
| 2023-03-01T00:24:37.198510
| 2021-02-06T19:03:59
| 2021-02-06T19:03:59
| 332,084,595
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 700
|
r
|
datasets.R
|
#' Field codes for BLAST results returned in tabular format
#'
#' A dataset containing the field codes for indicating the desired format of tabular BLAST results,
#' as well as the description of each field.
#'
#' @format A data frame with 50 rows and 2 variables
#' \describe{
#' \item{field}{output format (`outfmt`) field code}
#' \item{description}{brief description of information specified by the field}
#' }
#' @source `system("blastn -help")`
"fmtspec"
#> [1] "fmtspec"
#' List of datasets available for query through BLAST+/blastr
#'
#' @format A character vector with 34 database names
#' @source `system("update_blastdb.pl --showall", intern=TRUE)`
"blast_dbs"
#> [1] "blast_dbs"
|
7781ba10c54b68d8a75b076541c6ecf28bafef5a
|
9b30ee8fe2298796c9308af768cc8a915999c346
|
/R/chapter_2/tokens_lemma_stems.R
|
adf757d63e83db7955dd15e49e67fdb6adcd98ae
|
[] |
no_license
|
StephenHowe/working_practicalNLP
|
b70ecd2b7860633815be44bbce5e4351be1ace97
|
5cc00ebb9dd8daed23faac3108d0bee13103e5c0
|
refs/heads/master
| 2023-02-06T04:19:45.929406
| 2020-12-31T19:56:39
| 2020-12-31T19:56:39
| 323,355,704
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,306
|
r
|
tokens_lemma_stems.R
|
# Chapter 2, Exercise 4
# Tokenization, Stemming, Lemmatization, Stopword, Post-Staging
# 30 December 2020
# R version: 4.0.2
# libraries ----
library(tidyverse)
library(tidytext)
library(tokenizers)
library(tm)
library(textstem)
library(qdap)
# data ----
corpus_original <- "Need to finalize the demo corpus which will be used for this notebook and it should be done soon !!. It should be done by the ending of this month. But will it? This notebook has been run 4 times !!"
corpus <- "Need to finalize the demo corpus which will be used for this notebook & should be done soon !!. It should be done by the ending of this month. But will it? This notebook has been run 4 times !!"
# there are many ways of performing these clean-up steps and Base R has some simple and effective tools.
# to use tidytext you need to have more than one document. Technically, our corpus (above) is just a single document
# lower case the corpus
corpus_lower <- tolower(corpus) # base R
corpus_lower
# remove digits from the corpus
corpus_nonumbers <- gsub("[[:digit:]]", "", corpus) # use regex to remove digits
corpus_nonumbers
# more info on Regex and R: https://stat.ethz.ch/R-manual/R-devel/library/base/html/regex.html
# remove punctuation from the corpus
corpus_nopunct <- gsub("[[:punct:]]", "", corpus)
corpus_nopunct
# remove trailing white spaces
corpus_trailing <- gsub("\\s*$", "", corpus_nopunct) # using corpus_nopunct as it has trailing space
corpus_trailing
# tokenize the corpus
corpus_tokenized <- tokenize_words(corpus) # from the tokenizer package
corpus_tokenized
# documentation: https://cran.r-project.org/web/packages/tokenizers/tokenizers.pdf
# tokenize the corpus after removing stop words
data(stop_words) # load stop words from tidytext package
corpus_df <- as.data.frame(corpus_tokenized) # convert to dataframe
colnames(corpus_df) <- "words"
filter(corpus_df, !words %in% stop_words$word)
# stemming of corpus
tokenize_word_stems(corpus) # uses tokenizer package
# lemmatization of corpus
lemmatize_strings(corpus) # uses textstem package
# POS tagging
corpus_pos <- pos(corpus) # tags POS for each word
# this next line of code accesses the results and prints into pretty list of words and associated POS tag
as.vector(strsplit(corpus_pos[["POStagged"]][["POStagged"]], '\\s+'))
|
61227000d0a26fb85e63db45f55d3880533693ee
|
ddde45e191ff7bbb6c9345a06b4897b082ac030e
|
/ui.R
|
f7837396579bb73ad9759f1f144ea890f7a94ba6
|
[] |
no_license
|
emgns04/OpeningExplorerApp
|
70d6883b4f7978d2539eab84ba75bcd6e974aed9
|
f0e8f8a84ac4a51ebb8e14360a88f0e39784a6b4
|
refs/heads/master
| 2022-03-25T15:04:45.192156
| 2019-12-16T22:28:52
| 2019-12-16T22:28:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 673
|
r
|
ui.R
|
library(shiny)
fluidPage(
titlePanel("Chess Opening Explorer"),
# Copy the line below to make a select box
sidebarLayout(
sidebarPanel(
fileInput("file","Choose PGN file", accept = c(".pgn"))
),
mainPanel(
tableOutput("contents"),
plotOutput("barchart")
)
),
selectInput("select", label = h3("Select Move Depth"),
choices = list("1" = 1, "2" = 2, "3" = 3, "4" = 4,
"5" = 5, "6" = 6, "7" = 7, "8" = 8,
"9" = 9, "10" = 10),
selected = 1),
hr(),
fluidRow(column(3, verbatimTextOutput("value"))),
textOutput("games")
)
|
ffaa51c14247c6ec6caa9cd04ab7ab23d48873bb
|
f9a3e756cbb3cf0b7d85732609fba4a7ca786ad5
|
/wi19_favorite_books.R
|
750b78e193a2cd80626aa25f09646d4f4e0e5be2
|
[
"Apache-2.0"
] |
permissive
|
andreybutenko/201-favorites
|
5fa726ab11a891ffba8c624c3da002b6f57475c3
|
7062acd96b065fcc24d11da8463189f5d161cdd6
|
refs/heads/master
| 2020-04-18T21:51:38.629911
| 2019-01-27T06:19:59
| 2019-01-27T06:21:28
| 167,777,459
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 3,485
|
r
|
wi19_favorite_books.R
|
library(dplyr)
library(ggplot2)
library(scales)
data <- unlist(c(
c("Mr. Penumbra's 24-Hour Bookstore", "Ready Player One", "The Stranger", "Aristotle and Dante Discover the Secrets of the Universe", "The Subtle Art of Not Giving a F*ck", "The Thinking Person's Guide to Climate Change"),
c("The Kite Runner", "Harry Potter", "Lord of the Flies", "It", "A Thousand Splendid Suns", "Desert Solitaire"),
c("Gone Girl", "Shoe Dog", "1833", "The Snowball", "The Lord of the Rings", "The Kite Runner"),
c("Becoming", "Harry Potter", "Scrappy Little Nobody", "The Book Thief", "The Fault in Our Stars", "Hunger Games"),
c("The Complete Works of Edgar Allen Poe", "Confessions of a Heretic", "Clockwork Angel", "Miss Peregrine's Home for Peculiar Children", "Gospel of Filth", "God of Small Things"),
c("Extremely Loud and Incredibly Close", "A Tale of Two Cities", "All the Light We Cannot See", "Into the Wild", "The Great Gatsby", "Out of the Dust"),
c("The Great Gatsby","Of Mice and Man", "Robinson Crusoe", "Frankenstein","1984", "The Bell Jar"),
c("Count of Monte Cristo", "Sherlock Holmes", "Harry Potter", "The Alchemist", "The Warlock", "The War of the Ember"),
c("Le Petit Prince","NYPD 4","The Alchemist","Secret","Found","11 Birthdays"),
c("Harry Potter", "The Great Gatsby", "The Giving Tree", "The Cat in the Hat", "Red", "Hunger Games"),
c("Design of Everyday Things", "Hooked", "Always Hungry?", "Sapiens", "Silicon City", "Tested"),
c("Of Mice and Men", "The Great Gatsby", "1984", "Harry Potter", "Percy Jackson"),
c("The Godfather", "Thinking, Fast and Slow", "Intimate relationship", "Poor Charlie's Almanack", "lestime de soi", "SLEEP"),
c("Kafka on the Shore", "If Cats Disappeared from the World", "Miss Hokusai", "Through the Looking Glass", "Battle Royale", "The Girl who Leapt Through Time"),
c("Harry Potter", "Sherlock Holmes", "Fireflies", "After Dark", "Ready Player One", "Lord of the Rings"),
c("Nisei Daughter", "Digital Fortress", "Into Thin Air", "Norwegian Wood", "Ghost in the Wires", "The Da Vinci Code"),
c("The Stand", "Mr. Mercedes", "Percy Jackson", "Freakonomics", "Shoe Dog", "Hunger Games"),
c("The Alchemist", "Percy Jackson", "Animal Farm", "Mortal Coil", "A Game of Thrones", "The Cruel Prince"),
c("On Liberty", "Harry Potter", "City of Bones", "The Tyranny of Utility", "The Outsiders", "Outliers"),
c("The Bible", "Believer's Authority", "Every Good Endeavor","Book of Acts", "Your Spritual Gifts", "How People Grow"),
c("Becoming", "Cane", "Harry Potter", "Quicksand", "Passing", "The Design of Everyday Things"),
c("Psycho-Cybernetics", "Letters From a Stoic", "Harry Potter", "Cosmosapiens", "Cracking the Coding Interview", "Brave New World"),
c("Harry Potter"),
c("1984", "Animal Farm", "Brave New World", "Foundation", "The Left Hand of Darkness", "Ilium"),
c("Harry Potter", "Lord of the Flies", "Goose Girl", "Cinderella", "This Lullaby", "Black Panther")
))
favorite_books <- data %>%
table() %>% # Count frequencies of each unique value
as.data.frame() %>%
rename(book = '.', freq = Freq) %>%
arrange(-freq)
favorite_books %>%
filter(freq > 1) %>%
ggplot(aes(x = reorder(book, -freq), y = freq)) +
geom_bar(stat = 'identity') +
ggtitle('Our Favorite Books (INFO 201 AE Wi19)') +
xlab('Book title') +
ylab('Number of students who like the book') +
scale_y_continuous(breaks = pretty_breaks()) +
coord_flip() +
ggsave('wi19_favorite_books.png')
|
35df890c250e7a020d2488e8143b80257e7b004e
|
401793f16601f32fff4604e5845b49ce52dba27d
|
/Joinpoint.R
|
544499ac111f6b41a7df677f21f704c97ce0afb6
|
[] |
no_license
|
Hong-Kong-Longevity/Longevity
|
53081a4220a4c1d08e189317b2cdb2b4f96cbbed
|
0a7cc6ac2d0fb0e110447959704affa0dae8b269
|
refs/heads/main
| 2023-07-11T12:21:44.047147
| 2021-08-17T07:53:55
| 2021-08-17T07:53:55
| 363,084,157
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 4,964
|
r
|
Joinpoint.R
|
rm(list=ls())
require(devtools)
install_version("ggplot2", version = "3.2.1", repos = "http://cran.us.r-project.org")
library(ggplot2)
library(ggthemes)
library(dplyr)
# World bank data
WorldBank_LE <- read.csv("../Life expectancy/LE Overall.csv",h = T)
WorldBank_LE_male <- read.csv("../Life expectancy/LE Male.csv",h = T)
WorldBank_LE_female <- read.csv("../Life expectancy/LE Female.csv",h = T)
HICs <- c("Australia","Austria","Belgium","Canada","Denmark","Finland","France","Germany","Hong Kong","Italy","Japan","Netherlands","Norway","Portugal","Spain","Sweden","Switzerland","United Kingdom","United States")
# LE Ranking
HK_LE_rank_total <- WorldBank_LE %>% filter(Indicator == "Life expectancy") %>% select(-Indicator) %>%
melt(id = 'Country') %>%
mutate(value = as.numeric(value),
variable = as.numeric(substring(variable, 2, 5))) %>%
data.table() %>%
.[,ranking := sum(!is.na(value)) + 1 - rank(value, na.last = 'keep', ties.method = 'max'), by = variable] %>%
filter(`Country` == 'Hong Kong') %>%
rename(Year = variable,
e0 = value)
HK_LE_rank_male <- WorldBank_LE_male %>%
melt(id = 'Country.Name') %>%
mutate(value = as.numeric(value),
variable = as.numeric(substring(variable, 2, 5))) %>%
data.table() %>%
.[,ranking := sum(!is.na(value)) + 1 - rank(value, na.last = 'keep', ties.method = 'max'), by = variable] %>%
filter(`Country.Name` == 'Hong Kong SAR, China') %>%
rename(Year = variable,
e0 = value)
HK_LE_rank_male[,3][60] <- 82.2
HK_LE_rank_male[,4][60] <- 1
HK_LE_rank_female <- WorldBank_LE_female %>%
melt(id = 'Country.Name') %>%
mutate(value = as.numeric(value),
variable = as.numeric(substring(variable, 2, 5))) %>%
data.table() %>%
.[,ranking := sum(!is.na(value)) + 1 - rank(value, na.last = 'keep', ties.method = 'max'), by = variable] %>%
filter(`Country.Name` == 'Hong Kong SAR, China') %>%
rename(Year = variable,
e0 = value)
HK_LE_rank_female[,3][60] <- 88.1
HK_LE_rank_female[,4][60] <- 1
# Customzied color pallette
gg_color_hue <- function(n) {
hues = seq(15, 375, length = n + 1)
hcl(h = hues, l = 65, c = 100)[1:n]
}
colour1 <- c(gg_color_hue(2)[1],'blue')
#----------------------------------------------------------------------------
## Load output dataset from Joinpoint regression program
jp_seg <- read.csv('../Life expectancy/joinpoint segmented.csv',h = T)
seg <- read.csv('../Life expectancy/jp seg.csv',h = T)
# Plot-----------------------------------------------------------------------
g <- jp_seg %>% ggplot()+
# ranking of male e0 as background
geom_bar(data = HK_LE_rank_male,
aes(x = Year, y = (88.755 - ranking/1.6)),
stat = 'identity', alpha = 0.5, fill = "grey69")+
# ranking of female e0 as background
geom_bar(data = HK_LE_rank_female,
aes(x = Year, y = (88.755 - ranking/1.6)),
stat = 'identity', alpha = 0.5, fill = "grey22") +
scale_fill_manual(name="World ranking",labels=c('Men','Women'))+
# add labels of the breakpoints
geom_text(data = seg,
aes(x = seg[,'X1'], y = seg[,'X2'], label = round(seg[,'X1']), colour = NULL),
hjust = -.1,
vjust =1.1,
show.legend = FALSE)+
# points and lines for e0
geom_point(aes(x=Year,y=e0,colour=factor(Sex)),size=1.5) +
geom_line(aes(x=Year,y=e0,colour=factor(Sex)),size=0.7, alpha = 0.3) +
geom_line(aes(x=Year,y=segmented,colour=factor(Sex)), size=0.9)+
# theme
geom_hline(yintercept = 88.13, alpha = 0.1, linetype = 2) +
scale_x_continuous(expand=c(0.008,0), breaks = seq(1960, 2020, 10))+
scale_y_continuous(expand=c(0,0),
sec.axis = sec_axis(~(-.+88.755)*1.6,
name = "World ranking in life expectancy\n",
breaks = c(1, seq(10, 40, 10)),
labels = c(bquote(1^st), sapply(seq(10, 40, 10), function(x) bquote(.(x)^th)))))+
coord_cartesian(ylim=c(60,90))+
scale_colour_manual(values=c(colour1),name=NULL,labels=c('Women','Men'))+
theme_classic() +
theme(axis.line.x = element_line(color="black", size = 0.5),
axis.line.y = element_line(color="black", size = 0.5),
legend.position=c(0.2,0.85),
axis.text = element_text(size=14),
axis.title = element_text(size=16),
legend.text = element_text(size=12)) +
labs(x='Year',y='Life expectancy at birth (years)\n') +
guides(col = guide_legend(reverse = TRUE))
# Add breakpoint lines
for(i in 1:nrow(seg)){
x <- seg[i,'X1']
y <- seg[i,'X2']
colour <- colour1[3-seg[i,'L1']]
g <- g + geom_segment(x=x,xend=x,y=60,yend=y, colour=colour, linetype=2, size=1)
}
g
ggsave("../Life expectancy/Joinpoint 2018 rankings.png", width=8,height=8, dpi = 300)
|
49b8518634c7a71a11feb89a002a138d7b9839cc
|
3c258c7fe3244f4a41dea7d264098ac614eef19a
|
/man/parseTSSApprovals.Rd
|
8269a7cc4cbcf76634190c0265edae4b75d39098
|
[
"LicenseRef-scancode-warranty-disclaimer",
"CC0-1.0",
"LicenseRef-scancode-public-domain-disclaimer"
] |
permissive
|
USGS-R/repgen
|
379be8577f3effbe7067e2f3dc5b5481ca69999e
|
219615189fb054e3b421b6ffba4fdd9777494cfc
|
refs/heads/main
| 2023-04-19T05:51:15.008674
| 2021-04-06T20:29:38
| 2021-04-06T20:29:38
| 31,678,130
| 10
| 25
|
CC0-1.0
| 2023-04-07T23:10:19
| 2015-03-04T20:24:02
|
R
|
UTF-8
|
R
| false
| true
| 457
|
rd
|
parseTSSApprovals.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/timeseriessummary-data.R
\name{parseTSSApprovals}
\alias{parseTSSApprovals}
\title{Parse TSS Approvals}
\usage{
parseTSSApprovals(reportData, timezone)
}
\arguments{
\item{reportData}{The full report JSON object}
\item{timezone}{The timezone to parse data into}
}
\description{
TSS wrapper for the readApprovals function
that handles errors thrown and returns the proper data
}
|
4ad573e53eea279739cff2f99212eefbc1b53dc9
|
e27b606213c6cce75eb272e235437806b30a4a74
|
/par.reg/man/par.reg-package.Rd
|
1a21acbce44e9f679040eba21aa68d5b7f91dcdb
|
[] |
no_license
|
maurermatthias/master
|
86fa80ee32157b3e4b8c41299a1ea4f5fd303827
|
2dac3b1aabbf9d675d03d28ee1a9bf172853d9e7
|
refs/heads/master
| 2021-01-16T21:29:24.721057
| 2016-08-10T15:53:33
| 2016-08-10T15:53:33
| 65,395,814
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 2,689
|
rd
|
par.reg-package.Rd
|
\name{par.reg-package}
\alias{par.reg-package}
\alias{par.reg}
\docType{package}
\title{
Least-Square Parameter Regression
}
\description{
Package for performing a Least-Square fit for an user defined distribution of fatigue data.
}
\details{
\tabular{ll}{
Package: \tab par.reg\cr
Type: \tab Package\cr
Version: \tab 1.0\cr
Date: \tab 2015-11-21\cr
%License: \tab What license is it under?\cr
}
Within this package the function pr(...) is used to estimate parameters for fatigue-data. Therefore the data needs to contain multiple observations (cyrcles to failure) for each stress-level. First the parameters for the user-defined distributed observations are calculated for each stress-level and then a Least-Square fit is done. Also a chi-squared goodness of fit test is done. The function pr.sim(...) performes multiple time the function pr(...) with a subset of the observations and uses the other subset to perform a chi-squared goodness of fit test.
}
\author{
Matthias Maurer
}
%\references{
%~~ Literature or other references for background information ~~
%}
%~~ Optionally other standard keywords, one per line, from file KEYWORDS in the R documentation ~~
%~~ directory ~~
\keyword{ package }
%\seealso{
%~~ Optional links to other man pages, e.g. ~~
%~~ \code{\link[<pkg>:<pkg>-package]{<pkg>}} ~~
%}
\examples{
#defining the input list
gev=list();
gev[["distr"]]="gev"
data=load.data()
gev[["xval"]]=data[,1]
gev[["yval"]]=data[,2]
#print individual parameter estimations - decide on the parameter functions
gev[["type"]]="diag"
gev.result=pr(gev)
#defining additional input-list fields for fitting
gev[["type"]]="fit"
gev[["error.type"]]="rel"
gev[["validity.fun"]]="val.gev"
gev[["struct.fun"]]=c("gev1","gev2","gev3")
gev[["struct.start.parameter"]]=c(-0.31,49.67,20809,18.8,69.41)
gev[["quantiles"]]=1:9/10
#validity function
val.gev<-function(stress,parameter){
k=parameter[1];
a=parameter[2];
b=parameter[3];
c1=parameter[4];
c2=parameter[5];
if(b<=max(stress) || a>=min(stress) || c1<=0 || c2<=0 || k==0 || min(gev2(stress,parameter))<=0 ){
return(FALSE);
}else{
return(TRUE);
}
}
#xi gev-distibution
gev1<-function(stress,parameter){
k=parameter[1];
return(k);
}
#sigma^2 gev-distribution
gev2<-function(stress,parameter){
a=parameter[2];
b=parameter[3];
c1=parameter[4];
return(((b-a)/(stress-a)-1)*c1)
}
#mu gev-distribution
gev3<-function(stress,parameter){
a=parameter[2];
b=parameter[3];
c2=parameter[5];
return(((b-a)/(stress-a)-1)*c2)
}
#perform fit
gev.result=pr(gev)
#perform simulation
v=pr.sim(gev, 0.9, 50)
}
|
e668fa3737fc3bd3311e5ca4b9d4fcdbf326bf13
|
61180649c781ca23ee434754577acea001eb4bc0
|
/man/fcl.Rd
|
a650d08fb77545157e04e4a8bc10ee3a8239c43e
|
[] |
no_license
|
malexan/fclhs
|
87e0b4c9b86eb1c954644bbdb699699677d4163b
|
f93e69dd96bbd15bdbc68a5c52db5fe0dde3a0fa
|
refs/heads/master
| 2020-05-31T15:48:22.614152
| 2015-08-09T07:59:08
| 2015-08-09T07:59:08
| 27,025,796
| 0
| 2
| null | null | null | null |
UTF-8
|
R
| false
| false
| 302
|
rd
|
fcl.Rd
|
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/data.R
\name{fcl}
\alias{fcl}
\title{FCL items description.}
\format{A data frame with 776 observations of 6 variables.
\describe{
\item{fcl}{FCL-code of item, numeric.}
}}
\description{
FCL items description.
}
|
b5631498a7b9cba06d8c21191340d5f9dcf678c4
|
abb044dfc3ab84c6e27b8086d6a372c1cf3b0c9d
|
/build.R
|
def89754576245241e7ea219931492fb6e1f901e
|
[
"MIT"
] |
permissive
|
jbdatascience/causaloptim
|
ab6d984769cb64b79c5e59e291a94ddea1fd9593
|
03f4fbd7514a2921ba433f6b33ddd0d6f690c8f7
|
refs/heads/master
| 2022-04-24T03:07:48.840661
| 2020-04-22T07:49:14
| 2020-04-22T07:49:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 371
|
r
|
build.R
|
## build
file.copy("doc/shinyapp.html", "inst/shiny/interface/www/shinyapp.html", overwrite = TRUE)
devtools::build()
pkgdown::build_site(install = FALSE)
## fix path to images
lines <- readLines("docs/articles/shinyapp.html")
lines <- gsub("../../../../Box%20Sync/R%20projects/causaloptim/vignettes/", "", lines)
writeLines(lines, con = "docs/articles/shinyapp.html")
|
31d6880450d638936cfa3e011ff9412f7b4b188e
|
dc50015de0a6e030aa95f60af4e36367ada70f7e
|
/man/norm_diric.Rd
|
165a89ed10ee2345e3763ecd97e2a083834a4add
|
[] |
no_license
|
jamesrco/SpiecEasi
|
4eb4054faff131e950573bf927e2e41c0fc7f1de
|
dea87632935c109dc3e7f6804e71cfa6a4a7fc26
|
refs/heads/master
| 2021-01-25T10:06:08.918942
| 2018-02-11T16:29:11
| 2018-02-11T16:29:11
| 123,338,163
| 2
| 0
| null | 2018-02-28T20:23:48
| 2018-02-28T20:23:48
| null |
UTF-8
|
R
| false
| true
| 227
|
rd
|
norm_diric.Rd
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spaRcc.R
\name{norm_diric}
\alias{norm_diric}
\title{importFrom VGAM rdiric}
\usage{
norm_diric(x, rep = 1)
}
\description{
importFrom VGAM rdiric
}
|
5682caf132afd1e8ad2af3c733140729d3c14629
|
35c971607e75e037f7fc3c17eb69538674095781
|
/20170718ETL/etlggplot.R
|
529066dbefc086bb49b81d61c14e5e8b79e368cd
|
[] |
no_license
|
myfirstjump/Visualization
|
443072970def02e8c6e0dd482d6cde022c75d6fd
|
8db08d583381004eda40893825a47047771ecbd7
|
refs/heads/master
| 2021-06-23T18:49:31.498481
| 2018-10-02T05:30:23
| 2018-10-02T05:30:23
| 96,211,539
| 0
| 0
| null | null | null | null |
UTF-8
|
R
| false
| false
| 923
|
r
|
etlggplot.R
|
rm(list=ls())
#install.packages("ggplot2")
library(ggplot2)
library(dplyr)
head(diamonds)
str(diamonds)
diamonds[sample(nrow(diamonds), 10), ]
diamonds$carat
qplot(carat, data = diamonds, geom = "histogram")
toolRank = read.csv("D:/iiiR/20170718ETL/toolRank.csv")
target = toolRank[1:10,]
qplot(toolList, total, data = target, geom = "point") # 竟然不會照順序
str(target)
##
target$toolList <- factor(target$toolList, levels = target$toolList[order(target$toolList)])
str(target)
target$per = c(0.1,0.9)
target[1,"per"] = c(0.1,0.9)
ggplot(target,aes(x=toolList,y=total, fill=per))+ geom_bar(stat='identity') + scale_x_discrete(limits=target$toolList)
OrdToolList = toolRank$toolList[order(toolRank$toolList)]
stat='identity'
ntar = t(target)
ntar
position='stack'
target
java = c(58, 100)
df = data.frame(java)
df
bank = c("104", "1111")
df = cbind(df, bank)
ggplot(df, aes(x=java, fill=bank)) + geom_bar()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.