apsimx_filetype: Test file format for .apsimx files

View source: R/apsimx_filetype.R

apsimx_filetypeR Documentation

Test file format for .apsimx files

Description

Test whether an .apsimx file is XML or json

Usage

apsimx_filetype(file = "", src.dir = ".")

Arguments

file

file ending in .apsimx to be tested

src.dir

directory containing the .apsimx file to be tested; defaults to the current working directory

Value

‘xml’, ‘json’ or ‘unknown’

Note

Minimal function which reads only the first line in a file and tries to guess whether it is an ‘xml’ or ‘json’ file type.

Examples


extd.dir <- system.file("extdata", package = "apsimx")
apsimx_filetype("Wheat.apsimx", src.dir = extd.dir) 



apsimx documentation built on Sept. 11, 2024, 5:42 p.m.