View source: R/write_specs_file.R
write_specs_file | R Documentation |
The resulting file has the format required by the load_specs()
function.
In the future, this step could be bypassed by creating the list output
from load_specs()
directly.
This function is based on a subset of the RunFn() function in the older ADMB
version of this package.
write_specs_file(
dir = getwd(),
file_name = "data.spc",
nreaders,
biasopt = NULL,
sigopt = NULL,
knotages = NULL
)
dir |
Directory where the specifications file will be saved. |
file_name |
Name of the specifications file. |
nreaders |
An integer, specifying the number of readers. |
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 specifications file (file.path(dir, file_name)
).
Ian G. Taylor, James T. Thorson, Ian J. Stewart, Andre E. Punt
write_files()
, write_specs_file()
, load_specs()
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)
)
data_file <- write_data_file(data_test, dir = tempdir(), file_name = "test.dat")
specs_file <- write_specs_file(dir = tempdir(), nreaders = 3, file_name = "test.spc")
data <- load_data(DataFile = data_file)
specs <- load_specs(SpecsFile = specs_file, DataSpecs = data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.