Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Habitat Sampler
HabitatSampler
Commits
df769519
Commit
df769519
authored
Sep 14, 2021
by
Romulo Pereira Goncalves
Browse files
Use rast in all operations.
parent
1486a19e
Changes
1
Hide whitespace changes
Inline
Side-by-side
R-package/R/model_opt.r
View file @
df769519
...
...
@@ -50,10 +50,10 @@ model_opt_r <- function(k,
if
(
sample_type
==
"random"
)
{
set.seed
(
seed2
[
k
])
pbt
<-
raster
::
sampleRandom
(
rast
er
,
size
=
sample_size
,
sp
=
T
)
raster
::
sampleRandom
(
rast
,
size
=
sample_size
,
sp
=
T
)
}
if
(
sample_type
==
"regular"
)
{
pbt
<-
raster
::
sampleRegular
(
rast
er
,
size
=
sample_size
,
sp
=
T
)
pbt
<-
raster
::
sampleRegular
(
rast
,
size
=
sample_size
,
sp
=
T
)
}
#f <- which(is.na(pbt@data[1]))
#if (length(f) != 0) {
...
...
@@ -156,7 +156,7 @@ model_opt_r <- function(k,
if
(
ncol
(
test1
)
==
1
)
{
test1
<-
t
(
test1
)
}
colnames
(
test1
)
<-
names
(
rast
er
)
colnames
(
test1
)
<-
names
(
rast
)
}
if
(
class
(
test1
)[
1
]
==
"numeric"
)
{
test1
<-
t
(
matrix
(
test1
))
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment