Downloads and loads a dataset from predefined course servers or a user-defined URL.
Arguments
- name
character string. File name including extension (e.g.
"data.csv").- url
optional character string. Base URL where the file is located. If
NULL, default course repositories are searched.- header
logical. Whether the file contains a header row. Passed to
read.table().- sep
character. Field separator used in the file. Default is
";".- ...
additional arguments passed to the underlying import functions such as
read.table()oropenDataObject().
Value
a data frame or object returned by the respective import function:
for text files: a
data.frame.for Excel files: an object returned by
openDataObject().
Details
If no url is provided, the function searches for the file in
the following locations (see https://github.com/AndriSignorell/Teaching):
https://raw.githubusercontent.com/AndriSignorell/Teaching/main/book/https://raw.githubusercontent.com/AndriSignorell/Teaching/main/data/
The first location where the file exists is used.
File type handling:
.xls,.xlsx: loaded viaopenDataObject()other files: loaded via
read.table()
