<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Function to check wheather file is JSON format</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for is.json.file"><tr><td>is.json.file</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Function to check wheather file is JSON format</h2>

<h3>Description</h3>

<p>Function to check wheather file is JSON format
</p>


<h3>Usage</h3>

<pre>
is.json.file(
  file = Sys.getenv("R_CONFIGFILE_ACTIVE", "config.cfg"),
  json.file.debug = FALSE,
  ...
)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>file</code></td>
<td>
<p>File name of configuration file to test. Defaults to the value of
the 'R_CONFIGFILE_ACTIVE' environment variable ('config.cfg' if the
variable does not exist and JSON/INI/YAML/TOML format only)</p>
</td></tr>
<tr valign="top"><td><code>json.file.debug</code></td>
<td>
<p>If TRUE, it will show error infomation when read JSON config,
default is FALSE</p>
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
<p>Arguments for <code>readLines</code> and <code>fromJSON</code></p>
</td></tr>
</table>


<h3>Value</h3>

<p>Logical indicating whether the specified configuration file is JSON format
</p>


<h3>See Also</h3>

<p><code>is.ini.file</code>,
<code>is.yaml.file</code>,
<code>is.toml.file</code>
</p>


<h3>Examples</h3>

<pre>
config.json &lt;- system.file('extdata', 'config.json', package='configr')
config.ini &lt;- system.file('extdata', 'config.ini', package='configr')
config.yaml &lt;- system.file('extdata', 'config.yaml', package='configr')
config.toml &lt;- system.file('extdata', 'config.toml', package='configr')
print(is.json.file(config.json))
print(is.json.file(config.ini))
print(is.json.file(config.yaml))
print(is.json.file(config.toml))
</pre>


</body></html>
