Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Armin Rauschenberger
joinet
Commits
e8ba6460
Commit
e8ba6460
authored
Jul 31, 2019
by
Armin Rauschenberger
Browse files
automation
parent
1f5c7406
Changes
15
Hide whitespace changes
Inline
Side-by-side
.Rhistory
deleted
100644 → 0
View file @
1f5c7406
X
cor
(
X
)
cor
<-
cor
(
X
)
diag
(
cor
)
cor
sample
(
1
:
10
,
size
=
1
)
sample
(
1
:
10
,
size
=
1.5
)
sample
(
1
:
10
,
size
=
1.6
)
sample
(
1
:
10
,
size
=
1.7
)
sample
(
1
:
10
,
size
=
1.9
)
sample
(
1
:
10
,
size
=
2.0
)
y
<-
sign
(
y
)
*
abs
(
y
)
^
frame
$
k
[
j
]
hist
(
sign
(
y
)
*
abs
(
y
)
^
1
)
y
<-
rnorm
(
1000
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
1
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
2
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
5
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
0.5
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
0.1
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
0.1
,
breaks
=
50
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
0.1
,
breaks
=
20
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
0.1
,
breaks
=
10
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
0
,
breaks
=
50
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
Inf
,
breaks
=
50
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
Inf
,
breaks
=
50
,
xlim
=
c
(
-2
,
2
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
Inf
,
breaks
=
20
,
xlim
=
c
(
-2
,
2
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
Inf
,
breaks
=
10
,
xlim
=
c
(
-2
,
2
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
Inf
,
breaks
=
breaks
,
xlim
=
c
(
-2
,
2
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
Inf
,
breaks
=
50
,
xlim
=
c
(
-2
,
2
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
Inf
,
breaks
=
50
,
xlim
=
c
(
-2
,
2
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
Inf
,
breaks
=
50
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
Inf
,
breaks
=
50
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
99
,
breaks
=
50
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
9
,
breaks
=
50
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
1
,
breaks
=
50
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
y
)
*
abs
(
y
)
^
1
,
breaks
=
50
,
xlim
=
c
(
-1
,
1
))
y
y
<-
rnorm
(
1000
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
1
,
breaks
=
50
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
50
,
breaks
=
50
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
10
,
breaks
=
50
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
0.1
,
breaks
=
50
)
hist
(
sign
(
y
)
*
abs
(
y
)
^
0.2
,
breaks
=
50
)
0
^
0.2
-0.0001
^
0.2
(
-0.0001
)
^
0.2
(
-0.001
)
^
0.2
(
-0.01
)
^
0.2
(
0.01
)
^
0.2
(
0.01
)
^
0.05
(
0.01
)
^
0.05
(
0.01
)
^
0.05
(
0.01
)
^
0.001
(
0.01
)
^
0.000001
?
quantile
?
quantile
?
optim
f
=
expression
(
x
^
2+3
*
x
)
D
(
f
,
'x'
)
f
<-
expression
(
x
^
2+3
*
x
+
a
)
D
(
f
,
'x'
)
f
<-
expression
(
x
^
2+3
*
x
+
a
)
D
(
f
,
'x'
)
f
<-
expression
(
x
^
a
+3
*
x
)
D
(
f
,
'x'
)
f
<-
expression
((
1
-
pi
)
*
z
+
pi
*
phi
)
D
(
f
,
'x'
)
D
(
f
,
'pi'
)
f
<-
expression
((
1
-
pi
)
*
z
+
pi
*
phi
)
D
(
f
,
'pi'
)
f
<-
expression
(
sum
(
a
+
b
))
D
(
f
,
'pi'
)
0
^
1
?
ddnorm
?
dnorm
?
quantile
hist
(
rnorm
(
10000
))
hist
(
rnorm
(
10000
)
^
2
)
x
<-
rnorm
(
10000
)
^
2
hist
(
x
)
x
<-
rnorm
(
10000
)
hist
(
x
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
2
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
2
,
breaks
=
50
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
10
,
breaks
=
50
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
5
,
breaks
=
50
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
2
,
breaks
=
50
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
-2
),
breaks
=
50
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
-1
),
breaks
=
50
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
-0.2
),
breaks
=
50
)
80
/
5
80
/
30
80
/
5
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
-0.2
),
breaks
=
50
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
10
),
breaks
=
50
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
50
),
breaks
=
50
)
range
(
x
)
range
(
x
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
50
),
breaks
=
50
)
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
50
),
breaks
=
50
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
50
),
breaks
=
5000
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
10
),
breaks
=
5000
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
10
),
breaks
=
5000000
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
3
),
breaks
=
5000000
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
3
),
1e+06
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
3
),
10000
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
3
),
10000
,
xlim
=
c
(
-1
,
1
))
hist
(
sign
(
x
)
*
abs
(
x
)
^
(
3
),
10000
,
xlim
=
c
(
-2
,
2
))
range
(
sign
(
x
)
*
abs
(
x
)
^
(
3
))
range
(
sign
(
x
)
*
abs
(
x
)
^
(
1
))
range
(
sign
(
x
)
*
abs
(
x
)
^
(
5
))
(
-1
)
^
1000
(
-1.1
)
^
1000
(
-1
)
^
1000
(
-0.9
)
^
1000
?
p.adjust
set.seed
(
1
)
#devtools::install_github("rauschenberger/palasso",ref="4802b1d")
#devtools::install_github("rauschenberger/cornet",
# ref="bcfdcc0",dependencies=FALSE)
# devtools::install_github("rauschenberger/decline",ref="cb187ec",dependencies=FALSE)
rm
(
list
=
ls
(
all.names
=
TRUE
))
.source
<-
.target
<-
"C:/Users/armin.rauschenberger/Desktop/cornet/analysis"
# --- Preparing data. ---
load
(
file.path
(
.source
,
"ppmi_2018-11-20.RData"
),
verbose
=
TRUE
)
if
(
any
(
Y
[,
"visit0"
]
!=
X
$
"MOCA-MCATOT"
,
na.rm
=
TRUE
)){
stop
(
"Mismatch."
)}
if
(
any
(
rownames
(
Y
)
!=
rownames
(
X
))){
stop
(
"Mismatch."
)}
Y
<-
Y
[,
-1
]
X
<-
decline
::
curate_missing
(
X
)
X
<-
decline
::
curate_hidden
(
X
)
X
<-
decline
::
curate_levels
(
X
)
X
<-
decline
::
curate_constant
(
X
)
#--- multiple imputation ---
set.seed
(
1
)
names
<-
colnames
(
X
)
colnames
(
X
)
<-
paste0
(
"x"
,
seq_len
(
ncol
(
X
)))
X_imp
<-
list
()
for
(
i
in
seq_len
(
10
)){
X_imp
[[
i
]]
<-
missRanger
::
missRanger
(
data
=
X
,
pmm.k
=
3
,
num.trees
=
100
)
# before without pmm.k and num.trees
colnames
(
X_imp
[[
i
]])
<-
names
}
# --- Cross-validating models. ---
names
<-
paste0
(
rep
(
c
(
"lasso"
,
"ridge"
),
each
=
4
),
seq_len
(
4
))
loss
<-
fit
<-
pval
<-
list
()
for
(
i
in
seq_along
(
X_imp
)){
loss
[[
i
]]
<-
fit
[[
i
]]
<-
pval
[[
i
]]
<-
list
()
cat
(
"i ="
,
i
,
"\n"
)
x
<-
scale
(
decline
::
curate_dummies
(
as.data.frame
(
X_imp
[[
i
]])))
for
(
j
in
seq_along
(
names
)){
cat
(
"j ="
,
j
,
" "
)
alpha
<-
1
*
(
substr
(
names
[
j
],
start
=
1
,
stop
=
5
)
==
"lasso"
)
index
<-
as.numeric
(
substr
(
names
[
j
],
start
=
6
,
stop
=
6
))
y
<-
Y
[,
index
]
cond
<-
!
is.na
(
y
)
set.seed
(
i
)
loss
[[
i
]][[
names
[
j
]]]
<-
cornet
:::
cv.cornet
(
y
=
y
[
cond
],
cutoff
=
25.5
,
X
=
x
[
cond
,],
alpha
=
alpha
)
set.seed
(
i
)
fit
[[
i
]][[
names
[
j
]]]
<-
cornet
::
cornet
(
y
=
y
[
cond
],
cutoff
=
25.5
,
X
=
x
[
cond
,],
alpha
=
alpha
)
set.seed
(
i
)
pval
[[
i
]][[
names
[
j
]]]
<-
cornet
:::
.test
(
y
=
y
[
cond
],
cutoff
=
25.5
,
X
=
x
[
cond
,],
alpha
=
alpha
)
}
}
save
(
loss
,
fit
,
pval
,
file
=
file.path
(
.target
,
"application.RData"
))
#--- interpretation ---
load
(
file.path
(
.target
,
"application.RData"
),
verbose
=
TRUE
)
names
<-
c
(
paste0
(
"lasso"
,
1
:
4
),
paste0
(
"ridge"
,
1
:
4
))
frame
<-
data.frame
(
row.names
=
names
)
for
(
i
in
names
){
# proportion of data sets with deviance decrease
dev
<-
as.data.frame
(
t
(
sapply
(
loss
,
function
(
x
)
x
[[
i
]]
$
deviance
)))
frame
[
i
,
"dev.prop"
]
<-
round
(
mean
(
dev
$
combined
<
dev
$
binomial
),
digits
=
2
)
# deviance change in percent
dec
<-
(
dev
$
combined
-
dev
$
binomial
)
/
dev
$
binomial
frame
[
i
,
"dev.min"
]
<-
round
(
100
*
min
(
dec
),
digits
=
1
)
frame
[
i
,
"dev.max"
]
<-
round
(
100
*
max
(
dec
),
digits
=
1
)
# proportion of data sets with AUC increase
auc
<-
as.data.frame
(
t
(
sapply
(
loss
,
function
(
x
)
x
[[
i
]]
$
auc
)))
frame
[
i
,
"auc.prop"
]
<-
round
(
mean
(
auc
$
combined
>
auc
$
binomial
),
digits
=
2
)
# quantiles weight parameter
q
<-
round
(
quantile
(
sapply
(
fit
,
function
(
x
)
x
[[
i
]]
$
pi.min
),
probs
=
c
(
0
,
0.5
,
1
)),
digits
=
2
)
frame
[
i
,
"pi.min"
]
<-
q
[
1
]
frame
[
i
,
"pi.med"
]
<-
q
[
2
]
frame
[
i
,
"pi.max"
]
<-
q
[
3
]
# quantiles scale parameter
q
<-
round
(
quantile
(
sapply
(
fit
,
function
(
x
)
x
[[
i
]]
$
sigma.min
),
probs
=
c
(
0
,
0.5
,
1
)),
digits
=
2
)
frame
[
i
,
"sd.min"
]
<-
q
[
1
]
frame
[
i
,
"sd.med"
]
<-
q
[
2
]
frame
[
i
,
"sd.max"
]
<-
q
[
3
]
# significance based on multi-split
pvalue
<-
sapply
(
pval
,
function
(
x
)
median
(
unlist
(
x
[[
i
]])))
frame
[
i
,
"pval.min"
]
<-
signif
(
min
(
pvalue
),
digits
=
2
)
frame
[
i
,
"pval.max"
]
<-
signif
(
max
(
pvalue
),
digits
=
2
)
frame
[
i
,
"pval.prop"
]
<-
round
(
mean
(
pvalue
<
0.05
),
digits
=
2
)
}
frame
writeLines
(
text
=
capture.output
(
utils
::
sessionInfo
()),
con
=
file.path
(
.target
,
"info_app.txt"
))
?
auc
?
pROC
::
auc
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
50
,
50
))
predictor
<-
runif
(
100
)
auc
(
response
,
predictor
)
pROC
::
auc
(
response
,
predictor
)
pROC
::
auc
(
response
,
predictor
)
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
95
,
5
))
pROC
::
auc
(
response
,
predictor
)
pROC
::
auc
(
response
,
predictor
)
pROC
::
auc
(
response
,
predictor
)
pROC
::
auc
(
response
,
predictor
)
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
95
,
5
))
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
95
,
5
));
predictor
<-
runif
(
100
)
pROC
::
auc
(
response
,
predictor
)
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
95
,
5
));
predictor
<-
runif
(
100
)
pROC
::
auc
(
response
,
predictor
)
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
95
,
5
));
predictor
<-
runif
(
100
)
pROC
::
auc
(
response
,
predictor
)
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
95
,
5
));
predictor
<-
runif
(
100
)
pROC
::
auc
(
response
,
predictor
)
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
95
,
5
));
predictor
<-
0
pROC
::
auc
(
response
,
predictor
)
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
95
,
5
));
predictor
<-
rep
(
0
,
times
=
100
)
pROC
::
auc
(
response
,
predictor
)
response
<-
rep
(
c
(
0
,
1
),
times
=
c
(
95
,
5
));
predictor
<-
rep
(
1
,
times
=
100
)
pROC
::
auc
(
response
,
predictor
)
?
missRanger
?
missRanger
::
missRanger
install.packages
(
c
(
"assertthat"
,
"backports"
,
"callr"
,
"cli"
,
"clipr"
,
"curl"
,
"devtools"
,
"digest"
,
"evaluate"
,
"foreach"
,
"fs"
,
"git2r"
,
"glmnet"
,
"highr"
,
"iterators"
,
"knitr"
,
"markdown"
,
"mime"
,
"openssl"
,
"palasso"
,
"parsedate"
,
"pillar"
,
"pkgbuild"
,
"processx"
,
"purrr"
,
"rcmdcheck"
,
"Rcpp"
,
"rematch2"
,
"remotes"
,
"rhub"
,
"rlang"
,
"rmarkdown"
,
"rsconnect"
,
"rstudioapi"
,
"rversions"
,
"sys"
,
"testthat"
,
"tibble"
,
"tinytex"
,
"usethis"
,
"whoami"
,
"xfun"
,
"xml2"
))
##############
### cornet ###
##############
#--- generate toydata ----------------------------------------------------------
set.seed
(
1
)
#toydata <- NULL
#save(toydata,file=file.path("C:/Users/armin.rauschenberger/Desktop/package/cornet/data/toydata.R"))
#--- compile package -----------------------------------------------------------
rm
(
list
=
ls
())
name
<-
"cornet"
#load("D:/cornet/package/toydata.RData")
pkg
<-
"C:/Users/armin.rauschenberger/Desktop/cornet/cornet"
setwd
(
dir
=
pkg
)
devtools
::
as.package
(
x
=
pkg
,
create
=
FALSE
)
devtools
::
load_all
(
path
=
pkg
)
#usethis::use_data(toydata,overwrite=TRUE)
devtools
::
document
(
pkg
=
pkg
)
unlink
(
file.path
(
pkg
,
"vignettes"
,
"figure"
),
recursive
=
TRUE
)
#all <- dir(file.path(pkg,"vignettes"))
#delete <- "..."
#sapply(delete,function(x) file.remove(file.path(pkg,"vignettes",x)))
setwd
(
dir
=
pkg
)
unlink
(
file.path
(
pkg
,
"docs"
),
recursive
=
TRUE
)
pkgdown
::
build_site
(
pkg
=
pkg
)
file.remove
(
file.path
(
pkg
,
c
(
".Rbuildignore"
,
".Rhistory"
)))
usethis
::
use_build_ignore
(
files
=
c
(
"Readme.Rmd"
,
".travis.yml"
,
"_pkgdown.yml"
,
"docs"
,
"cran-comments.md"
,
"appveyor.yml"
,
".Rhistory"
))
devtools
::
check
(
pkg
=
pkg
,
quiet
=
FALSE
,
manual
=
TRUE
)
devtools
::
install
(
pkg
=
pkg
,
upgrade
=
FALSE
)
##############
### mixnet ###
##############
#--- generate toydata ----------------------------------------------------------
set.seed
(
1
)
#toydata <- NULL
#save(toydata,file=file.path("C:/Users/armin.rauschenberger/Desktop/package/cornet/data/toydata.R"))
#--- compile package -----------------------------------------------------------
rm
(
list
=
ls
())
name
<-
"mixnet"
#load("D:/cornet/package/toydata.RData")
pkg
<-
"C:/Users/armin.rauschenberger/Desktop/mixnet/mixnet"
setwd
(
dir
=
pkg
)
devtools
::
as.package
(
x
=
pkg
,
create
=
FALSE
)
devtools
::
load_all
(
path
=
pkg
)
#usethis::use_data(toydata,overwrite=TRUE)
devtools
::
document
(
pkg
=
pkg
)
unlink
(
file.path
(
pkg
,
"vignettes"
,
"figure"
),
recursive
=
TRUE
)
setwd
(
dir
=
pkg
)
unlink
(
file.path
(
pkg
,
"docs"
),
recursive
=
TRUE
)
pkgdown
::
build_site
(
pkg
=
pkg
)
file.remove
(
file.path
(
pkg
,
c
(
".Rbuildignore"
,
".Rhistory"
)))
usethis
::
use_build_ignore
(
files
=
c
(
"Readme.Rmd"
,
".travis.yml"
,
"_pkgdown.yml"
,
"docs"
,
"cran-comments.md"
,
"appveyor.yml"
,
".Rhistory"
))
devtools
::
check
(
pkg
=
pkg
,
quiet
=
FALSE
,
manual
=
TRUE
)
devtools
::
install
(
pkg
=
pkg
,
upgrade
=
FALSE
)
cornet
::
.check
cornet
:::
.check
file.remove
(
file.path
(
pkg
,
c
(
".Rbuildignore"
,
".Rhistory"
)))
usethis
::
use_build_ignore
(
files
=
c
(
"Readme.Rmd"
,
".travis.yml"
,
"_pkgdown.yml"
,
"docs"
,
"cran-comments.md"
,
"appveyor.yml"
,
".Rhistory"
))
#--- generate toydata ----------------------------------------------------------
set.seed
(
1
)
#toydata <- NULL
#save(toydata,file=file.path("C:/Users/armin.rauschenberger/Desktop/package/cornet/data/toydata.R"))
#--- compile package -----------------------------------------------------------
rm
(
list
=
ls
())
name
<-
"mixnet"
#load("D:/cornet/package/toydata.RData")
pkg
<-
"C:/Users/armin.rauschenberger/Desktop/mixnet/mixnet"
setwd
(
dir
=
pkg
)
devtools
::
as.package
(
x
=
pkg
,
create
=
FALSE
)
devtools
::
load_all
(
path
=
pkg
)
#usethis::use_data(toydata,overwrite=TRUE)
devtools
::
document
(
pkg
=
pkg
)
unlink
(
file.path
(
pkg
,
"vignettes"
,
"figure"
),
recursive
=
TRUE
)
setwd
(
dir
=
pkg
)
unlink
(
file.path
(
pkg
,
"docs"
),
recursive
=
TRUE
)
pkgdown
::
build_site
(
pkg
=
pkg
)
file.remove
(
file.path
(
pkg
,
c
(
".Rbuildignore"
,
".Rhistory"
)))
usethis
::
use_build_ignore
(
files
=
c
(
"Readme.Rmd"
,
".travis.yml"
,
"_pkgdown.yml"
,
"docs"
,
"cran-comments.md"
,
"appveyor.yml"
,
".Rhistory"
))
devtools
::
check
(
pkg
=
pkg
,
quiet
=
FALSE
,
manual
=
TRUE
)
?
palasso
:::
.folds
palasso
::
.folds
palasso
:::
.folds
cornet
:::
.check
usethis
::
use_build_ignore
(
files
=
c
(
"Readme.Rmd"
,
".travis.yml"
,
"_pkgdown.yml"
,
"docs"
,
"cran-comments.md"
,
"appveyor.yml"
,
".Rhistory"
))
?
usethis
::
use_build_ignore
file.remove
(
file.path
(
pkg
,
c
(
".Rbuildignore"
,
".Rhistory"
)))
usethis
::
use_build_ignore
(
files
=
c
(
"Readme.Rmd"
,
".travis.yml"
,
"_pkgdown.yml"
,
"docs"
,
"cran-comments.md"
,
"appveyor.yml"
,
".Rhistory"
))
usethis
::
use_build_ignore
(
files
=
c
(
"Readme.Rmd"
,
".travis.yml"
,
"_pkgdown.yml"
,
"docs"
,
"cran-comments.md"
,
"appveyor.yml"
,
".Rhistory"
))
pkg
set.seed
(
1
)
rm
(
list
=
ls
())
name
<-
"mixnet"
pkg
<-
"C:/Users/armin.rauschenberger/Desktop/mixnet/mixnet"
setwd
(
dir
=
pkg
)
devtools
::
as.package
(
x
=
pkg
,
create
=
FALSE
)
devtools
::
load_all
(
path
=
pkg
)
#usethis::use_data(toydata,overwrite=TRUE)
devtools
::
document
(
pkg
=
pkg
)
?
unlink
unlink
(
file.path
(
pkg
,
"vignettes"
,
"figure"
),
recursive
=
TRUE
)
setwd
(
dir
=
pkg
)
unlink
(
file.path
(
pkg
,
"docs"
),
recursive
=
TRUE
)
pkgdown
::
build_site
(
pkg
=
pkg
)
usethis
::
use_build_ignore
(
files
=
c
(
"Readme.Rmd"
,
".travis.yml"
,
"_pkgdown.yml"
,
"docs"
,
"cran-comments.md"
,
"appveyor.yml"
,
".Rhistory"
))
file.remove
(
file.path
(
pkg
,
c
(
".Rbuildignore"
,
".Rhistory"
)))
usethis
::
use_build_ignore
(
files
=
c
(
"Readme.Rmd"
,
".travis.yml"
,
"_pkgdown.yml"
,
"docs"
,
"cran-comments.md"
,
"appveyor.yml"
,
".Rhistory"
))
devtools
::
check
(
pkg
=
pkg
,
quiet
=
FALSE
,
manual
=
TRUE
)
devtools
::
spell_check
(
pkg
=
pkg
)
devtools
::
check_rhub
(
pkg
=
pkg
)
#pkg <- "C:/Users/armin.rauschenberger/Desktop/mixnet/mixnet"
setwd
(
pkg
)
pkg
system
(
"git remote set-url origin https://rauschenberger:Eu57Rom!@github.com/rauschenberger/mixnet.git"
)
system
(
"git remote -v"
)
system
(
"git add --all"
)
system
(
"git commit -m \"automation\""
)
system
(
"git push origin master"
)
# GitHub
#install.packages("plsgenomics")
data
(
Ecoli
,
package
=
"plsgenomics"
)
install.packages
(
"plsgenomics"
)
install.packages
(
"BiocManager"
)
BiocManager
::
install
(
"mixOmics"
)
##############
### mixnet ###
##############
#--- generate toydata ----------------------------------------------------------
set.seed
(
1
)
#toydata <- NULL
#save(toydata,file=file.path("C:/Users/armin.rauschenberger/Desktop/package/cornet/data/toydata.R"))
#--- compile package -----------------------------------------------------------
rm
(
list
=
ls
())
name
<-
"mixnet"
#load("D:/cornet/package/toydata.RData")
pkg
<-
"C:/Users/armin.rauschenberger/Desktop/mixnet/mixnet"
setwd
(
dir
=
pkg
)
devtools
::
as.package
(
x
=
pkg
,
create
=
FALSE
)
devtools
::
load_all
(
path
=
pkg
)
#usethis::use_data(toydata,overwrite=TRUE)
devtools
::
document
(
pkg
=
pkg
)
unlink
(
file.path
(
pkg
,
"vignettes"
,
"figure"
),
recursive
=
TRUE
)
setwd
(
dir
=
pkg
)
unlink
(
file.path
(
pkg
,
"docs"
),
recursive
=
TRUE
)
pkgdown
::
build_site
(
pkg
=
pkg
)
#file.remove(file.path(pkg,c(".Rbuildignore",".Rhistory")))
#usethis::use_build_ignore(files=c("Readme.Rmd",".travis.yml","_pkgdown.yml","docs","cran-comments.md","appveyor.yml",".Rhistory"))
devtools
::
check
(
pkg
=
pkg
,
quiet
=
FALSE
,
manual
=
TRUE
)
devtools
::
install
(
pkg
=
pkg
,
upgrade
=
FALSE
)
#install.packages("plsgenomics")
data
(
Ecoli
,
package
=
"plsgenomics"
)
X
<-
Ecoli
$
CONNECdata
Y
<-
Ecoli
$
GEdata
loss
<-
mixnet
:::
cv.mixnet
(
Y
=
Y
,
X
=
X
)
loss
loss
[
"meta"
,]
<
loss
[
"base"
,]
mean
(
loss
[
"meta"
,]
<
loss
[
"base"
,])
mean
(
loss
[
"meta"
,]
<
loss
[
"base"
,])
#install.packages("BiocManager")
#BiocManager::install("mixOmics")
data
(
liver.toxicity
,
package
=
"mixOmics"
)
X
<-
liver.toxicity
$
gene
Y
<-
liver.toxicity
$
clinic
Y
$
Cholesterol.mg.dL.
<-
-
Y
$
Cholesterol.mg.dL.
loss
<-
mixnet
:::
cv.mixnet
(
Y
=
Y
,
X
=
X
)
mean
(
loss
[
"meta"
,]
<
loss
[
"base"
,])
loss
mean
(
loss
[
"meta"
,]
<=
loss
[
"base"
,])
sum
(
loss
[
"meta"
,]
<=
loss
[
"base"
,])
/
sum
(
loss
[
"meta"
,]
<=
loss
[
"base"
,])
sum
(
loss
[
"meta"
,]
<=
loss
[
"base"
,])
/
sum
(
loss
[
"meta"
,]
<=
loss
[
"base"
,])
sum
(
loss
[
"meta"
,]
<=
loss
[
"base"
,])
/
sum
(
loss
[
"base"
,]
<=
loss
[
"none"
,])
loss
#install.packages("plsgenomics")
data
(
Ecoli
,
package
=
"plsgenomics"
)
X
<-
Ecoli
$
CONNECdata
Y
<-
Ecoli
$
GEdata
loss
<-
mixnet
:::
cv.mixnet
(
Y
=
Y
,
X
=
X
)
rowMeans
(
loss
)
mean
(
loss
[
"meta"
,]
<=
loss
[
"base"
,])
data
(
Ecoli
,
package
=
"plsgenomics"
)
X
<-
Ecoli
$
CONNECdata
Y
<-
Ecoli
$
GEdata
loss
<-
mixnet
:::
cv.mixnet
(
Y
=
Y
,
X
=
X
)
mean
(
loss
[
"meta"
,]
<=
loss
[
"base"
,])
##############
### mixnet ###
##############
#--- generate toydata ----------------------------------------------------------
set.seed
(
1
)
#toydata <- NULL
#save(toydata,file=file.path("C:/Users/armin.rauschenberger/Desktop/package/cornet/data/toydata.R"))
#--- compile package -----------------------------------------------------------
rm
(
list
=
ls
())
name
<-
"mixnet"
#load("D:/cornet/package/toydata.RData")
pkg
<-
"C:/Users/armin.rauschenberger/Desktop/mixnet/mixnet"
setwd
(
dir
=
pkg
)
devtools
::
as.package
(
x
=
pkg
,
create
=
FALSE
)
devtools
::
load_all
(
path
=
pkg
)
#usethis::use_data(toydata,overwrite=TRUE)
devtools
::
document
(
pkg
=
pkg
)
unlink
(
file.path
(
pkg
,
"vignettes"
,
"figure"
),
recursive
=
TRUE
)
setwd
(
dir
=
pkg
)
unlink
(
file.path
(
pkg
,
"docs"
),
recursive
=
TRUE
)
pkgdown
::
build_site
(
pkg
=
pkg
)
#file.remove(file.path(pkg,c(".Rbuildignore",".Rhistory")))
#usethis::use_build_ignore(files=c("Readme.Rmd",".travis.yml","_pkgdown.yml","docs","cran-comments.md","appveyor.yml",".Rhistory"))
devtools
::
check
(
pkg
=
pkg
,
quiet
=
FALSE
,
manual
=
TRUE
)
devtools
::
install
(
pkg
=
pkg
,
upgrade
=
FALSE
)
#devtools::build(pkg=pkg)
#devtools::build(pkg=pkg,binary=TRUE) # only for zip file
#.rs.restartR()
#pkg <- "C:/Users/armin.rauschenberger/Desktop/cornet/cornet"
#version <- substring(text=readLines(file.path(pkg,"DESCRIPTION"))[[2]],first=10)
#archive <- paste0("C:/Users/armin.rauschenberger/Desktop/cornet/cornet_",version,".zip")
#utils::install.packages(archive,repos=NULL)
#--- upload package ------------------------------------------------------------
#pkg <- "C:/Users/armin.rauschenberger/Desktop/mixnet/mixnet"
setwd
(
pkg
)
system
(
"git remote set-url origin https://rauschenberger:Eu57Rom!@github.com/rauschenberger/mixnet.git"
)
system
(
"git remote -v"
)
system
(
"git add --all"
)
system
(
"git commit -m \"automation\""
)
system
(
"git push origin master"
)
# GitHub
##############
### mixnet ###
##############
#--- generate toydata ----------------------------------------------------------
set.seed
(
1
)
#toydata <- NULL
#save(toydata,file=file.path("C:/Users/armin.rauschenberger/Desktop/package/cornet/data/toydata.R"))
#--- compile package -----------------------------------------------------------
rm
(
list
=
ls
())
name
<-
"mixnet"
#load("D:/cornet/package/toydata.RData")
pkg
<-
"C:/Users/armin.rauschenberger/Desktop/mixnet/mixnet"
setwd
(
dir
=
pkg
)
devtools
::
as.package
(
x
=
pkg
,
create
=
FALSE
)
devtools
::
load_all
(
path
=
pkg
)
#usethis::use_data(toydata,overwrite=TRUE)
devtools
::
document
(
pkg
=
pkg
)
unlink
(
file.path
(
pkg
,
"vignettes"
,
"figure"
),
recursive
=
TRUE
)
setwd
(
dir
=
pkg
)
unlink
(
file.path
(
pkg
,
"docs"
),
recursive
=
TRUE
)
pkgdown
::
build_site
(
pkg
=
pkg
)
#file.remove(file.path(pkg,c(".Rbuildignore",".Rhistory")))
#usethis::use_build_ignore(files=c("Readme.Rmd",".travis.yml","_pkgdown.yml","docs","cran-comments.md","appveyor.yml",".Rhistory"))
devtools
::
check
(
pkg
=
pkg
,
quiet
=
FALSE
,
manual
=
TRUE
)
devtools
::
install
(
pkg
=
pkg
,
upgrade
=
FALSE
)
#devtools::build(pkg=pkg)
#devtools::build(pkg=pkg,binary=TRUE) # only for zip file
#.rs.restartR()
#pkg <- "C:/Users/armin.rauschenberger/Desktop/cornet/cornet"
#version <- substring(text=readLines(file.path(pkg,"DESCRIPTION"))[[2]],first=10)
#archive <- paste0("C:/Users/armin.rauschenberger/Desktop/cornet/cornet_",version,".zip")
#utils::install.packages(archive,repos=NULL)
#--- upload package ------------------------------------------------------------
#pkg <- "C:/Users/armin.rauschenberger/Desktop/mixnet/mixnet"
setwd
(
pkg
)
system
(
"git remote set-url origin https://rauschenberger:Eu57Rom!@github.com/rauschenberger/mixnet.git"
)
system
(
"git remote -v"
)
system
(
"git add --all"
)
system
(
"git commit -m \"automation\""
)
system
(
"git push origin master"
)
# GitHub
set.seed
(
1
)
#toydata <- NULL
#save(toydata,file=file.path("C:/Users/armin.rauschenberger/Desktop/package/cornet/data/toydata.R"))
#--- compile package -----------------------------------------------------------
rm
(
list
=
ls
())
name
<-
"joinet"
#load("D:/cornet/package/toydata.RData")
pkg
<-
"C:/Users/armin.rauschenberger/Desktop/joinet/joinet"
setwd
(
dir
=
pkg
)
devtools
::
as.package
(
x
=
pkg
,
create
=
FALSE
)
devtools
::
load_all
(
path
=
pkg
)
#usethis::use_data(toydata,overwrite=TRUE)
devtools
::
document
(
pkg
=
pkg
)
unlink
(
file.path
(
pkg
,
"vignettes"
,
"figure"
),
recursive
=
TRUE
)
setwd
(
dir
=
pkg
)
unlink
(
file.path
(
pkg
,
"docs"
),
recursive
=
TRUE
)
pkgdown
::
build_site
(
pkg
=
pkg
)
#file.remove(file.path(pkg,c(".Rbuildignore",".Rhistory")))
#usethis::use_build_ignore(files=c("Readme.Rmd",".travis.yml","_pkgdown.yml","docs","cran-comments.md","appveyor.yml",".Rhistory"))
devtools
::
check
(
pkg
=
pkg
,
quiet
=
FALSE
,
manual
=
TRUE
)
devtools
::
install
(
pkg
=
pkg
,
upgrade
=
FALSE
)
NEWS.md
View file @
e8ba6460
##
mix
net 0.0.1 (2019-0
6-0
1)
##
joi
net 0.0.1 (2019-0
7-3
1)
*
first submission
\ No newline at end of file
_pkgdown.yml
View file @
e8ba6460
...
...
@@ -9,10 +9,10 @@ authors:
home
:
links
:
-
text
:
"
Download
package"
href
:
https://github.com/rauschenberger/
mix
net
href
:
https://github.com/rauschenberger/
joi
net
navbar
:
title
:
"
mix
net"
title
:
"
joi
net"
left
:
-
text
:
"
functions"
href
:
reference/index.html
...
...
@@ -24,17 +24,17 @@ navbar:
href
:
news/index.html
right
:
-
icon
:
fa-github
href
:
https://github.com/rauschenberger/
mix
net
href
:
https://github.com/rauschenberger/
joi
net
-
icon
:
fa-download
href
:
https://cran.r-project.org/package=
mix
net
href
:
https://cran.r-project.org/package=
joi
net
reference
:
-
title
:
"
User
functions"
contents
:
-
mix
net
-
predict.
mix
net
-
coef.
mix
net
-
weights.
mix
net
-
joi
net
-
predict.
joi
net
-
coef.
joi
net
-
weights.
joi
net
-
title
:
"
Internal
functions"
contents
:
-
cv.
mix
net
-
cv.
joi
net
docs/articles/article.html
View file @
e8ba6460
...
...
@@ -51,13 +51,13 @@
</ul>
<ul
class=
"nav navbar-nav navbar-right"
>
<li>
<a
href=
"https://github.com/rauschenberger/
mix
net"
>
<a
href=
"https://github.com/rauschenberger/
joi
net"
>
<span
class=
"fa fa-github"
></span>
</a>
</li>
<li>
<a
href=
"https://cran.r-project.org/package=
mix
net"
>
<a
href=
"https://cran.r-project.org/package=
joi
net"
>
<span
class=
"fa fa-download"
></span>
</a>
...
...
docs/articles/index.html
View file @
e8ba6460
...
...
@@ -82,13 +82,13 @@
<ul
class=
"nav navbar-nav navbar-right"
>
<li>
<a
href=
"https://github.com/rauschenberger/
mix
net"
>
<a
href=
"https://github.com/rauschenberger/
joi
net"
>
<span
class=
"fa fa-github"
></span>
</a>
</li>
<li>