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
Amine GHOZLANE
shaman
Commits
1b6761f1
Commit
1b6761f1
authored
Oct 07, 2019
by
Amine GHOZLANE
Browse files
Solved issue with missing data in diversities
parent
d82b7044
Pipeline
#15935
passed with stage
in 8 minutes and 18 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Rfunctions/VisuPlot.R
View file @
1b6761f1
...
...
@@ -446,32 +446,36 @@ Plot_Visu_Diversity <- function(input,resDiff,ForScatter=FALSE, alpha_transparen
#save(counts_tmp_combined,targetInt,file = "testDiv.RData")
alpha
<-
tapply
(
TaxoNumber
(
counts_tmp_combined
),
targetInt
$
AllVar
,
mean
)
alpha
=
alpha
[
!
is.na
(
alpha
)]
alpha_selected
=
!
is.na
(
alpha
)
alpha
=
alpha
[
alpha_selected
]
alpha_sd
=
tapply
(
TaxoNumber
(
counts_tmp_combined
),
targetInt
$
AllVar
,
sd
)
alpha_sd
=
alpha_sd
[
!
is.na
(
alpha_sd
)
]
ci.alpha.down
=
pmax
(
alpha
-
1.96
*
alpha_sd
/
sqrt.nb
,
0
)
ci.alpha.up
=
alpha
+
1.96
*
alpha_sd
/
sqrt.nb
alpha_sd
=
alpha_sd
[
alpha_selected
]
ci.alpha.down
=
pmax
(
alpha
-
1.96
*
alpha_sd
/
sqrt.nb
[
alpha_selected
]
,
0
)
ci.alpha.up
=
alpha
+
1.96
*
alpha_sd
/
sqrt.nb
[
alpha_selected
]
shan
<-
tapply
(
vegan
::
diversity
(
counts_tmp_combined
,
index
=
"shannon"
),
targetInt
$
AllVar
,
mean
)
shan
=
shan
[
!
is.na
(
shan
)]
shan_selected
=
!
is.na
(
shan
)
shan
=
shan
[
shan_selected
]
shan_sd
=
tapply
(
vegan
::
diversity
(
counts_tmp_combined
,
index
=
"shannon"
),
targetInt
$
AllVar
,
sd
)
shan_sd
=
shan_sd
[
!
is.na
(
shan_sd
)
]
ci.shan.down
=
pmax
(
shan
-
1.96
*
shan_sd
/
sqrt.nb
,
0
)
ci.shan.up
=
shan
+
1.96
*
shan_sd
/
sqrt.nb
shan_sd
=
shan_sd
[
shan_selected
]
ci.shan.down
=
pmax
(
shan
-
1.96
*
shan_sd
/
sqrt.nb
[
shan_selected
]
,
0
)
ci.shan.up
=
shan
+
1.96
*
shan_sd
/
sqrt.nb
[
shan_selected
]
simpson
<-
tapply
(
vegan
::
diversity
(
counts_tmp_combined
,
index
=
"simpson"
),
targetInt
$
AllVar
,
mean
)
simpson
=
simpson
[
!
is.na
(
simpson
)]
simpson_selected
=
!
is.na
(
simpson
)
simpson
=
simpson
[
simpson_selected
]
simpson_sd
=
tapply
(
vegan
::
diversity
(
counts_tmp_combined
,
index
=
"simpson"
),
targetInt
$
AllVar
,
sd
)
simpson_sd
=
simpson_sd
[
!
is.na
(
simpson_sd
)
]
ci.simpson.down
=
pmax
(
simpson
-
1.96
*
simpson_sd
/
sqrt.nb
,
0
)
ci.simpson.up
=
simpson
+
1.96
*
simpson_sd
/
sqrt.nb
simpson_sd
=
simpson_sd
[
simpson_s
electe
d
]
ci.simpson.down
=
pmax
(
simpson
-
1.96
*
simpson_sd
/
sqrt.nb
[
simpson_selected
]
,
0
)
ci.simpson.up
=
simpson
+
1.96
*
simpson_sd
/
sqrt.nb
[
simpson_selected
]
invsimpson
<-
tapply
(
vegan
::
diversity
(
counts_tmp_combined
,
index
=
"invsimpson"
),
targetInt
$
AllVar
,
mean
)
invsimpson
=
invsimpson
[
!
is.na
(
invsimpson
)]
invsimpson_selected
=
!
is.na
(
invsimpson
)
invsimpson
=
invsimpson
[
invsimpson_selected
]
invsimpson_sd
=
tapply
(
vegan
::
diversity
(
counts_tmp_combined
,
index
=
"invsimpson"
),
targetInt
$
AllVar
,
sd
)
invsimpson_sd
=
invsimpson_sd
[
!
is.na
(
invsimpson_sd
)
]
ci.invsimpson.down
=
pmax
(
invsimpson
-
1.96
*
invsimpson_sd
/
sqrt.nb
,
0
)
ci.invsimpson.up
=
invsimpson
+
1.96
*
invsimpson_sd
/
sqrt.nb
invsimpson_sd
=
invsimpson_sd
[
invsimpson_s
electe
d
]
ci.invsimpson.down
=
pmax
(
invsimpson
-
1.96
*
invsimpson_sd
/
sqrt.nb
[
invsimpson_selected
]
,
0
)
ci.invsimpson.up
=
invsimpson
+
1.96
*
invsimpson_sd
/
sqrt.nb
[
invsimpson_selected
]
gamma
<-
TaxoNumber
(
counts_tmp_combined
,
targetInt
$
AllVar
)
gamma
=
gamma
[
!
is.na
(
gamma
)]
...
...
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