-
Notifications
You must be signed in to change notification settings - Fork 0
/
phenoselection_RUN.R
270 lines (19 loc) · 1.53 KB
/
phenoselection_RUN.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
######################################################################################################
### phenoselection, R script implementing phenotypic selection gradients from Lande & Arnold 1983 ###
######################################################################################################
####################### by Moises Exposito-Alonso ###################################
# Phenotypic selection gradients from Lande and Arnold 1985.
# Includes bootstrap evaluation of significance
# (1) @@@@@@@ INPUT DATA - edit this bit @@@@@@@#
Var1="enter a vector of numerical values of phenotype 1"
Var2="enter a vector of numerical values of phenotype 2" # notice that the results will be reported in the same order as these two variables
Fitness= "enter a vector of numerical values of fitness"
heritability1="enter a number ranging from 0 to 1"
gencorrelation="enter a number from -1 to 1"
heritability2="enter a number ranging from 0 to 1"
Gmatrix=matrix(c(heritabilty1,gencorrelation,gencorrelation, heritability2,ncol=2)
# if you don't wish to calculate reponse to selection, run:
Gmatrix=NULL
# (2) @@@@@@@ THIS IS THE FINAL COMMAND TO DO ALL THE ANALYSES @@@@@@@#
source("phenoselection_FUNCTIONS.R")
PHENOSELECTION(Var1=Var1,Var2=Var2,Fitness=Fitness,Gmatrix=Gmatrix)