qread | R Documentation |
Wrapper to readxl::read_excel
with minor changes to default settings:
columns of dates with no time component have class "Date" rather than "POSIX"
empty columns are read in as class "character" rather than "logical"
the max number of rows used to guess column types is 10k rather than 1k
qread(
path,
sheet = NULL,
range = NULL,
col_names = TRUE,
col_types = NULL,
simplify_dates = TRUE,
empty_cols_to_chr = TRUE,
na = "",
trim_ws = TRUE,
skip = 0,
n_max = Inf,
guess_max = min(10000, n_max),
progress = FALSE,
.name_repair = "unique"
)
path |
Path to the xls/xlsx file. |
sheet |
Sheet to read. Either a string (the name of a sheet), or an
integer (the position of the sheet). Ignored if the sheet is specified via
|
range |
A cell range to read from, as described in cell-specification.
Includes typical Excel ranges like "B3:D87", possibly including the sheet
name like "Budget!B2:G14", and more. Interpreted strictly, even if the
range forces the inclusion of leading or trailing empty rows or columns.
Takes precedence over |
col_names |
|
col_types |
Either |
simplify_dates |
Logical indicating whether to convert date columns
lacking a time component to class "Date". By default readxl::read_excel
reads columns containing dates or datetimes as class POSIX, even if there
is no time component (i.e. in which case the times will all be "00:00:00").
If |
empty_cols_to_chr |
Logical indicating whether columns of class
"logical" containing all missing values should be converted to class
"character". If argument |
na |
Character vector of strings to interpret as missing values. By default, readxl treats blank cells as missing data. |
trim_ws |
Should leading and trailing whitespace be trimmed? |
skip |
Minimum number of rows to skip before reading anything, be it
column names or data. Leading empty rows are automatically skipped, so this
is a lower bound. Ignored if |
n_max |
Maximum number of data rows to read. Trailing empty rows are
automatically skipped, so this is an upper bound on the number of rows in
the returned tibble. Ignored if |
guess_max |
Maximum number of data rows to use for guessing column types. |
progress |
Display a progress spinner? By default, the spinner appears
only in an interactive session, outside the context of knitting a document,
and when the call is likely to run for several seconds or more. See
|
.name_repair |
Handling of column names. Passed along to
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.