Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
jlopez
project_population_guillaume_martin
Commits
2961dd1e
Commit
2961dd1e
authored
Jan 10, 2018
by
jlopez
Browse files
add doc & fix warnings
parent
a3d7bfe8
Changes
2
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
2961dd1e
...
...
@@ -32,5 +32,7 @@ vignettes/*.pdf
*.utf8.md
*.knit.md
*.o
*.so
.Rproj.user
R/simulation.R
View file @
2961dd1e
...
...
@@ -15,6 +15,9 @@
#' @param na integer :
#' @param natba integer : Min nb of genotype copies to consider this genotype as advantageous
#' @param nbreps integer :
#' @param have_rescuers logical : if you want rescuers file
#' @param have_rate logical : if you want rate file (you need have_rescuers=TRUE)
#' @param output_path string : the output path
#' @param verbose logical : if you want a verbose program
#' @return array :
simulation
<-
function
(
max_geno
=
500
,
range
=
c
(
-0.05
,
-0.1
,
-0.15
),
...
...
@@ -146,7 +149,7 @@ Rbuiltlandscape <- function(n, ne, Es, so, na)
xo
<-
numeric
(
n
)
if
(
so
!=
0
)
{
#if so = 0, all the genotypic values stay at 0
x1
<-
rnorm
(
n
)
xo
<-
x1
*
sqrt
(
2
*
so
/
(
t
(
x1
)
%*%
S
%*%
x1
)
)
xo
<-
x1
*
as.vector
(
sqrt
(
2
*
so
/
(
t
(
x1
)
%*%
S
%*%
x1
)
)
)
}
return
(
list
(
M
=
M
,
Sb
=
S
,
A
=
A
,
xo
=
xo
))
...
...
Write
Preview
Supports
Markdown
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