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
b26321f2
Commit
b26321f2
authored
Feb 05, 2019
by
Armin Rauschenberger
Browse files
automation
parent
f50d3a09
Changes
2
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
b26321f2
...
...
@@ -3,8 +3,8 @@ Version: 0.0.0
Title: Elastic Net for Dichotomised Outcomes
Description: Implements lasso and ridge regression for dichotomised outcomes.
Depends: R (>= 3.0.0)
Imports: glmnet, MASS, weights, palasso
, colorspace
Suggests: knitr, testthat
Imports: glmnet, MASS, weights, palasso
Suggests: knitr, testthat
, RColorBrewer
Authors@R: person("Armin","Rauschenberger",email="a.rauschenberger@vumc.nl",role=c("aut","cre"))
VignetteBuilder: knitr
License: GPL-3
...
...
R/functions.R
View file @
b26321f2
...
...
@@ -303,7 +303,15 @@ plot.cornet <- function(x,...){
k
<-
100
levels
<-
stats
::
quantile
(
x
$
cvm
,
probs
=
seq
(
from
=
0
,
to
=
1
,
length.out
=
k
+1
))
col
<-
colorspace
::
diverge_hsv
(
n
=
k
)
## RColorBrewer
if
(
"RColorBrewer"
%in%
.packages
(
all.available
=
TRUE
)){
pal
<-
rev
(
c
(
"white"
,
RColorBrewer
::
brewer.pal
(
n
=
9
,
name
=
"Blues"
)))
col
<-
grDevices
::
colorRampPalette
(
colors
=
pal
)(
k
)
}
else
{
col
<-
grDevices
::
heat.colors
(
n
=
k
)
}
nsigma
<-
length
(
x
$
sigma
)
npi
<-
length
(
x
$
pi
)
...
...
@@ -324,7 +332,7 @@ plot.cornet <- function(x,...){
graphics
::
axis
(
side
=
1
,
at
=
c
(
1
,
ssigma
,
nsigma
),
labels
=
signif
(
x
$
sigma
[
c
(
1
,
ssigma
,
nsigma
)],
digits
=
2
))
graphics
::
axis
(
side
=
2
,
at
=
c
(
1
,
spi
,
npi
),
labels
=
signif
(
x
$
pi
[
c
(
1
,
spi
,
npi
)],
digits
=
2
))
# point for tuned parameters
graphics
::
points
(
x
=
ssigma
,
y
=
spi
,
pch
=
4
,
col
=
"
black
"
,
cex
=
1
)
graphics
::
points
(
x
=
ssigma
,
y
=
spi
,
pch
=
4
,
col
=
"
white
"
,
cex
=
1
)
}
else
{
# axes with standard labels
at
<-
seq
(
from
=
1
,
to
=
nsigma
,
length.out
=
5
)
...
...
@@ -334,7 +342,7 @@ plot.cornet <- function(x,...){
# points for selected parameters
isigma
<-
sapply
(
x
$
sigma.min
,
function
(
y
)
which
(
x
$
sigma
==
y
))
ipi
<-
sapply
(
x
$
pi.min
,
function
(
y
)
which
(
x
$
pi
==
y
))
graphics
::
points
(
x
=
isigma
,
y
=
ipi
,
pch
=
4
,
col
=
"
black
"
,
cex
=
1
)
graphics
::
points
(
x
=
isigma
,
y
=
ipi
,
pch
=
4
,
col
=
"
white
"
,
cex
=
1
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment