Description Usage Arguments Value Error messages
Short-hand functions for retriving file information such as number of columns or rows, or picking the first column (relevant if this contains IDs).
get_ncols
returns number of columns.
get_nlines
returns number of lines.
get_firstcolumn
is a wrapper for read.table
that allows the user
to easily get the first column(s) by padding colClasses
with "NULL"
character elements to
skip columns.
1 2 3 4 5 | get_ncols(file)
get_nlines(fn)
get_firstcolumn(fn, class = "integer", ...)
|
file |
Filename or connection to read from. |
fn |
Filename. |
class |
Character vector of classes to use for column(s), see |
... |
Parameters sent to |
get_ncols
: Number of read fields, including ID columns.
get_nlines
: Number of lines, or NA
on error.
get_firstcolumn
: Vector with elements of first column, or data.frame
if class
contains multiple not-"NULL"
elements.
get_nlines
is implemented in Fortran and may return NA
with an error message, if an error is encountered.
IOSTAT errors:
The first column most likely contains non-integer or non-numeric elements.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.