View source: R/create.bootstrap.data.R
create.bootstrap.data | R Documentation |
This function creates one realisation of bootstrapped data based on dis.data
.
The default resampling unit is transect.id
which may be modified using the argument resample
.
create.bootstrap.data(
dis.data,
resample = "transect.id",
rename = "segment.id",
stratum = NULL
)
dis.data |
Original data to be bootstrapped. Requires a column that matches argument |
resample |
Specifies the resampling unit for bootstrapping, default is |
rename |
A vector of column names for which a new column needs to be created for the bootstrapped data. This defaults to |
stratum |
The column name in |
Returns one realisation of bootstrapped distance data. Note that a new column
(in addition to those listed under argument rename
) is created. If the default for resample
is used,
a column with new unique ids called transect.id2
.
Note that a new column is created with renamed bootstrap resamples to preserve the number of unique bootstrap resamples.
If the default for resample
is used, i.e. transect.id
, this new column is called transect.id2
.
In addition, a new column segment.id2
is created which is required for other bootstrap functions.
data(dis.data.re)
# run distance analysis to create NHATS
dis.data.re$survey.id<-paste(dis.data.re$season,dis.data.re$impact,sep="")
result<-ddf(dsmodel=~mcds(key="hn", formula=~1), data=dis.data.re, method="ds",
meta.data=list(width=250))
dis.data.re<-create.NHAT(dis.data.re,result)
# bootstrap data without stratification
bootstrap.data<-create.bootstrap.data(dis.data.re)
# boostrap data with stratification (here by survey which is composed of
# season and impact)
dis.data.re$survey.id<-paste(dis.data.re$season,dis.data.re$impact,sep="")
bootstrap.data.str<-create.bootstrap.data(dis.data.re, stratum = "survey.id")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.