Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
manuscript_code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maria Voigt
manuscript_code
Commits
5bacc151
Commit
5bacc151
authored
8 years ago
by
Maria Voigt
Browse files
Options
Downloads
Patches
Plain Diff
changing the way the right columns are picked out of data-frame
parent
b5eb1ef0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/prediction/abundance_prediction.R
+6
-5
6 additions, 5 deletions
src/prediction/abundance_prediction.R
with
6 additions
and
5 deletions
src/prediction/abundance_prediction.R
+
6
−
5
View file @
5bacc151
...
...
@@ -39,7 +39,7 @@ print(paste("year " , year_to_predict))
indir_fun
<-
"~/orangutan_density_distribution/src/functions/"
crs_aea
<-
"+proj=aea +lat_1=7 +lat_2=-32 +lat_0=-15 +lon_0=125 +x_0=0
+y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
# final projection
#-------------------------------#
# Load and prepare coefficients #
...
...
@@ -49,14 +49,15 @@ source(file.path(indir_fun, "generic/path.to.current.R"))
print
(
"function loaded"
)
# Load coefficients and weights
coeff_weigh
ts_path
<-
path.to.current
(
indir
,
"
coeff_weigh
ts"
,
"rds"
)
print
(
paste
(
"this is
coeff_weights_path:"
,
coeff_weigh
ts_path
))
coeff_weights
<-
readRDS
(
coeff_weigh
ts_path
)
abundMod_resul
ts_path
<-
path.to.current
(
indir
,
"
abundMod_resul
ts"
,
"rds"
)
print
(
paste
(
"this is
abundMod_results_path:"
,
abundMod_resul
ts_path
))
abundMod_results
<-
readRDS
(
abundMod_resul
ts_path
)
# exclude the first column, which contains models, exclude the coefficient of the
# autocorellation term and the weighted aic of the model
# we are excluding the autocorellation term, because the mean is zero, and thus
# it will not have an influence on the overall outcome
coeffs
<-
coeff_weights
[
,
2
:
(
length
(
coeff_weights
)
-
2
)]
coeffs
<-
abundMod_results
[
,
grepl
(
x
=
colnames
(
abundMod_results
),
pattern
=
"coeff"
)]
# all predictors that are not included in a specific model have NA as their
# coefficient, which is replaced by 0, so that the estimate is also 0
coeffs
[
is.na
(
coeffs
)
==
T
]
<-
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment