<metaproperty="og:title"content="Read data from 4D database — read.4D"/>
<metaproperty="og:description"content="This function is only useful for the MMB department of the UMCG. Use this function to import data by just defining the file parameter. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with as.mo and transform all antimicrobial columns with as.rsi."/>
<p>This function is only useful for the MMB department of the UMCG. Use this function to <strong>import data by just defining the <code>file</code> parameter</strong>. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with <code><ahref='as.mo.html'>as.mo</a></code> and transform all antimicrobial columns with <code><ahref='as.rsi.html'>as.rsi</a></code>.</p>
<td><p>the name of the file which the data are to be read from.
Each row of the table appears as one line of the file. If it does
not contain an <em>absolute</em> path, the file name is
<em>relative</em> to the current working directory,
<code><ahref='https://www.rdocumentation.org/packages/base/topics/getwd'>getwd</a>()</code>. Tilde-expansion is performed where supported.
This can be a compressed file (see <code><ahref='https://www.rdocumentation.org/packages/base/topics/connections'>file</a></code>).</p>
<p>Alternatively, <code>file</code> can be a readable text-mode
<ahref='https://www.rdocumentation.org/packages/base/topics/connections'>connection</a> (which will be opened for reading if
necessary, and if so <code><ahref='https://www.rdocumentation.org/packages/base/topics/connections'>close</a></code>d (and hence destroyed) at
the end of the function call). (If <code><ahref='https://www.rdocumentation.org/packages/base/topics/showConnections'>stdin</a>()</code> is used,
the prompts for lines may be somewhat confusing. Terminate input
with a blank line or an EOF signal, <code>Ctrl-D</code> on Unix and
<code>Ctrl-Z</code> on Windows. Any pushback on <code><ahref='https://www.rdocumentation.org/packages/base/topics/showConnections'>stdin()</a></code> will be
cleared before return.)</p>
<p><code>file</code> can also be a complete URL. (For the supported URL
schemes, see the ‘URLs’ section of the help for
<td><p>a logical to indicate whether info about the import should be printed, defaults to <code>TRUE</code> in interactive sessions</p></td>
</tr>
<tr>
<th>header</th>
<td><p>a logical value indicating whether the file contains the
names of the variables as its first line. If missing, the value is
determined from the file format: <code>header</code> is set to <code>TRUE</code>
if and only if the first row contains one fewer field than the
number of columns.</p></td>
</tr>
<tr>
<th>row.names</th>
<td><p>a vector of row names. This can be a vector giving
the actual row names, or a single number giving the column of the
table which contains the row names, or character string giving the
name of the table column containing the row names.</p>
<p>If there is a header and the first row contains one fewer field than
the number of columns, the first column in the input is used for the
row names. Otherwise if <code>row.names</code> is missing, the rows are
numbered.</p>
<p>Using <code>row.names = NULL</code> forces row numbering. Missing or
<code>NULL</code><code>row.names</code> generate row names that are considered
to be ‘automatic’ (and not preserved by <code><ahref='https://www.rdocumentation.org/packages/base/topics/matrix'>as.matrix</a></code>).</p></td>
</tr>
<tr>
<th>sep</th>
<td><p>the field separator character. Values on each line of the
file are separated by this character. If <code>sep = ""</code> (the
default for <code>read.table</code>) the separator is ‘white space’,
that is one or more spaces, tabs, newlines or carriage returns.</p></td>
</tr>
<tr>
<th>quote</th>
<td><p>the set of quoting characters. To disable quoting
altogether, use <code>quote = ""</code>. See <code><ahref='https://www.rdocumentation.org/packages/base/topics/scan'>scan</a></code> for the
behaviour on quotes embedded in quotes. Quoting is only considered
for columns read as character, which is all of them unless
<code>colClasses</code> is specified.</p></td>
</tr>
<tr>
<th>dec</th>
<td><p>the character used in the file for decimal points.</p></td>
</tr>
<tr>
<th>na.strings</th>
<td><p>a character vector of strings which are to be
interpreted as <code><ahref='https://www.rdocumentation.org/packages/base/topics/NA'>NA</a></code> values. Blank fields are also
considered to be missing values in logical, integer, numeric and
complex fields. Note that the test happens <em>after</em>
white space is stripped from the input, so <code>na.strings</code>
values may need their own white space stripped in advance.</p></td>
</tr>
<tr>
<th>skip</th>
<td><p>integer: the number of lines of the data file to skip before
beginning to read data.</p></td>
</tr>
<tr>
<th>check.names</th>
<td><p>logical. If <code>TRUE</code> then the names of the
variables in the data frame are checked to ensure that they are
syntactically valid variable names. If necessary they are adjusted
(by <code><ahref='https://www.rdocumentation.org/packages/base/topics/make.names'>make.names</a></code>) so that they are, and also to ensure
that there are no duplicates.</p></td>
</tr>
<tr>
<th>strip.white</th>
<td><p>logical. Used only when <code>sep</code> has
been specified, and allows the stripping of leading and trailing
white space from unquoted <code>character</code> fields (<code>numeric</code> fields
are always stripped). See <code><ahref='https://www.rdocumentation.org/packages/base/topics/scan'>scan</a></code> for further details
(including the exact meaning of ‘white space’),
remembering that the columns may include the row names.</p></td>
</tr>
<tr>
<th>fill</th>
<td><p>logical. If <code>TRUE</code> then in case the rows have unequal
length, blank fields are implicitly added. See ‘Details’.</p></td>
</tr>
<tr>
<th>blank.lines.skip</th>
<td><p>logical: if <code>TRUE</code> blank lines in the
input are ignored.</p></td>
</tr>
<tr>
<th>stringsAsFactors</th>
<td><p>logical: should character vectors be converted
to factors? Note that this is overridden by <code>as.is</code> and
<code>colClasses</code>, both of which allow finer control.</p></td>
</tr>
<tr>
<th>fileEncoding</th>
<td><p>character string: if non-empty declares the
encoding used on a file (not a connection) so the character data can
be re-encoded. See the ‘Encoding’ section of the help for
<code><ahref='https://www.rdocumentation.org/packages/base/topics/connections'>file</a></code>, the ‘R Data Import/Export Manual’ and
‘Note’.</p></td>
</tr>
<tr>
<th>encoding</th>
<td><p>encoding to be assumed for input strings. It is
used to mark character strings as known to be in
Latin-1 or UTF-8 (see <code><ahref='https://www.rdocumentation.org/packages/base/topics/Encoding'>Encoding</a></code>): it is not used to
re-encode the input, but allows <spanstyle="R">R</span> to handle encoded strings in
their native encoding (if one of those two). See ‘Value’
<p>On our website <ahref='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <ahref='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <ahref='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <ahref='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<p>Developed by <ahref='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <ahref='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <ahref='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <ahref='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>, <ahref='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>