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
reservebenefit
worldmap_fish_genetic_diversity
Commits
a4b9a6fc
Commit
a4b9a6fc
authored
Oct 22, 2019
by
peguerin
Browse files
GD_mean already raw values
parent
4b0264dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
00-scripts/step5/analysis/tests.R
View file @
a4b9a6fc
...
...
@@ -73,26 +73,22 @@ convertedCoords_M=convert_coordinates_into_epsg4326(dcM, dcM.1, grid)
convertedCoords_F
=
convert_coordinates_into_epsg4326
(
dcF
,
dcF.1
,
grid
)
dcM.2
=
cbind
(
dcM.1
,
convertedCoords_M
)
dcF.2
=
cbind
(
dcF.1
,
convertedCoords_F
)
## add non transformed GD values
GD_mean_raw_M
=
dcM
[
which
(
dcM
$
cell
%in%
dcM.1
$
cell
),]
$
GD_mean
GD_mean_raw_F
=
dcF
[
which
(
dcF
$
cell
%in%
dcF.1
$
cell
),]
$
GD_mean
dcM.3
=
cbind
(
dcM.2
,
GD_mean_raw_M
)
dcF.3
=
cbind
(
dcF.2
,
GD_mean_raw_F
)
## load richness data
richness
=
read.csv
(
"01-infos/equalarea_id_coordsCA_FWRS_MR_RS.csv"
)
Fr
=
merge
(
dcF.
3
,
richness
,
by
=
"cell"
,
all.x
=
F
)
Fr
=
merge
(
dcF.
2
,
richness
,
by
=
"cell"
,
all.x
=
F
)
Fr
=
Fr
[
which
(
Fr
$
RS_FW_FISH
!=
0
),]
Fr_wCoords
=
Fr
[,
c
(
2
,
3
,
4
,
6
,
7
,
24
,
2
5
,
30
)]
#with coordinates
Fr
=
Fr
[,
c
(
1
,
4
,
6
,
7
,
24
,
2
5
,
30
)]
Fr_wCoords
=
Fr
[,
c
(
2
,
3
,
4
,
6
,
7
,
24
,
2
9
)]
#with coordinates
Fr
=
Fr
[,
c
(
1
,
4
,
6
,
7
,
24
,
2
9
)]
Fr
=
na.omit
(
Fr
)
names
(
Fr
)
=
c
(
"cell"
,
"
scaled_
GD_mean"
,
"nb_species"
,
"nb_indv_mean"
,
"latitude"
,
"
GD_mean"
,
"
richness"
)
Mr
=
merge
(
dcM.
3
,
richness
,
by
=
"cell"
,
all.x
=
F
)
names
(
Fr
)
=
c
(
"cell"
,
"GD_mean"
,
"nb_species"
,
"nb_indv_mean"
,
"latitude"
,
"richness"
)
Mr
=
merge
(
dcM.
2
,
richness
,
by
=
"cell"
,
all.x
=
F
)
Mr
=
Mr
[
which
(
Mr
$
RS_MR_FISH
!=
0
),]
Mr_wCoords
=
Mr
[,
c
(
2
,
3
,
4
,
6
,
7
,
24
,
25
,
31
)]
#with coordinates
Mr
=
Mr
[,
c
(
1
,
4
,
6
,
7
,
24
,
25
,
31
)]
Mr_wCoords
=
Mr
[,
c
(
2
,
3
,
4
,
6
,
7
,
24
,
30
)]
#with coordinates
Mr
=
Mr
[,
c
(
1
,
4
,
6
,
7
,
24
,
30
)]
Mr
=
na.omit
(
Mr
)
names
(
Mr
)
=
c
(
"cell"
,
"
scaled_
GD_mean"
,
"nb_species"
,
"nb_indv_mean"
,
"latitude"
,
"
GD_mean"
,
"
richness"
)
names
(
Mr
)
=
c
(
"cell"
,
"GD_mean"
,
"nb_species"
,
"nb_indv_mean"
,
"latitude"
,
"richness"
)
Tr
=
rbind
(
Mr
,
Fr
)
...
...
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