write_files | R Documentation |
Write the input files (data and specifications) for the AgeingError package
write_files(
dat,
dir = getwd(),
file_dat = "data.dat",
file_specs = "data.spc",
minage = 0,
maxage = NULL,
refage = NULL,
minusage = NULL,
plusage = NULL,
biasopt = NULL,
sigopt = NULL,
knotages = NULL
)
dat |
Dataframe or tibble with columns for each reader and rows for
each age reading combination. This could either have a count column or
not. If not, |
dir |
Directory where the data file will be saved. |
minage |
An integer, specifying the minimum possible "true" age. |
maxage |
An integer, specifying the maximum possible "true" age. |
refage |
An arbitrarily chosen age from which "true" age-composition fixed-effects are calculated as an offset. This has no effect on the answer but could potentially effect estimation speed. By default this will be set to the maxage / 4. |
minusage |
The minimum age for which an age-specific age-composition is
estimated. Ages below
,
where beta is an estimated log-linear trend in the "true"
proportion-at-age. If |
plusage |
Identical to |
biasopt |
A vector with one entry for each reader specifying the
type of bias specific to each reader. Positive values lead to estimated
parameters and negative values are used for shared parameters between
readers. Parameter sharing (mirroring) is common when there
is more than one reader in a lab working together to refine their methods
such that they have matching techniques.
If NULL is passed, the default is Possible entries include the following:
An example entry for the situation where you have seven readers and you
assume that the first reader is unbiased, readers 2-7 have a curvilinear
bias, reader 3 shares parameters with reader 2, reader 5 shares parameters
with reader 4, and reader 7 shares parameters with reader 6 would look
like |
sigopt |
A vector with one entry for each reader.
Each entry specifies the functional
form of reading error as a function of true age. Positive values lead to
estimated parameters and negative values are used for shared parameters
between readers.
If NULL is passed, the default is Possible entries include the following:
|
knotages |
Ages associated with each knot. This is a necessary input
for |
Invisibly returns the path to the data file (file.path(dir, file_name)
).
Ian G. Taylor, James T. Thorson, Ian J. Stewart, Andre E. Punt
load_data()
, tally_repeats()
, write_specs_file()
data_test <- data.frame(
reader1 = c(7, 10, 7, 6, 6, 10, 7, 9, 8, 10, 10, 5, 6, 7, 9, 7, 7, 5, 8, 5),
reader2 = c(8, 10, 7, 6, 6, 10, 7, 9, 8, 10, 10, 5, 6, 7, 9, 7, 7, NA, NA, NA),
reader3 = c(7, 10, 7, 6, 6, 8, 7, 9, 8, 10, 10, 5, 6, 7, NA, NA, NA, 5, 8, 5)
)
write_files(dat = data_test, dir = tempdir())
run(dir = tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.