specfile.character: Identify the Data Specification File for a Model

Description Usage Arguments Value See Also Examples

View source: R/path.R

Description

Identifies the data specification file associated with the datafile used by a model. Locates the datafile specified in the control stream, and substitutes a different extension.

Usage

1
2
## S3 method for class 'character'
specfile(x, find = "\\.csv$", use = ".spec", ...)

Arguments

x

the model name

find

file extension to replace

use

file extension to use

...

pass ext over-ride default file extension in datafile()

Value

character

See Also

datafile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(spec)
source <- system.file(package = 'nonmemica','project')
target <- tempdir()
target <- gsub('\\\\','/',target) # for windows
file.copy(source,target,recursive = TRUE)
project <- file.path(target,'project','model')
options(project = project)
library(magrittr)
1001 %>% datafile
datafile(1001) %matches% specfile(1001)
1001 %>% specfile
1001 %>% specfile %>% read.spec

bergsmat/nonmemica documentation built on Sept. 28, 2018, 4:11 p.m.