bb_wget | R Documentation |
This function is an R wrapper to the command-line wget
utility, which is called using either the exec_wait
or the exec_internal
function from the sys package. Almost all of the parameters to bb_wget
are translated into command-line flags to wget
. Call bb_wget("help")
to get more information about wget's command line flags. If required, command-line flags without equivalent bb_wget
function parameters can be passed via the extra_flags
parameter.
bb_wget(
url,
recursive = TRUE,
level = 1,
wait = 0,
accept,
reject,
accept_regex,
reject_regex,
exclude_directories,
restrict_file_names,
progress,
user,
password,
output_file,
robots_off = FALSE,
timestamping = FALSE,
no_if_modified_since = FALSE,
no_clobber = FALSE,
no_parent = TRUE,
no_check_certificate = FALSE,
relative = FALSE,
adjust_extension = FALSE,
retr_symlinks = FALSE,
extra_flags = character(),
verbose = FALSE,
capture_stdout = FALSE,
quiet = FALSE,
debug = FALSE
)
url |
string: the URL to retrieve |
recursive |
logical: if true, turn on recursive retrieving |
level |
integer >=0: recursively download to this maximum depth level. Only applicable if |
wait |
numeric >=0: wait this number of seconds between successive retrievals. This option may help with servers that block multiple successive requests, by introducing a delay between requests |
accept |
character: character vector with one or more entries. Each entry specifies a comma-separated list of filename suffixes or patterns to accept. Note that if any of the wildcard characters '*', '?', '[', or ']' appear in an element of accept, it will be treated as a filename pattern, rather than a filename suffix. In this case, you have to enclose the pattern in quotes, for example |
reject |
character: as for |
accept_regex |
character: character vector with one or more entries. Each entry provides a regular expression that is applied to the complete URL. Matching URLs will be accepted for download |
reject_regex |
character: as for |
exclude_directories |
character: character vector with one or more entries. Each entry specifies a comma-separated list of directories you wish to exclude from download. Elements may contain wildcards |
restrict_file_names |
character: vector of one of more strings from the set "unix", "windows", "nocontrol", "ascii", "lowercase", and "uppercase". See https://www.gnu.org/software/wget/manual/wget.html#index-Windows-file-names for more information on this parameter. |
progress |
string: the type of progress indicator you wish to use. Legal indicators are "dot" and "bar". "dot" prints progress with dots, with each dot representing a fixed amount of downloaded data. The style can be adjusted: "dot:mega" will show 64K per dot and 3M per line; "dot:giga" shows 1M per dot and 32M per line. See https://www.gnu.org/software/wget/manual/wget.html#index-dot-style for more information |
user |
string: username used to authenticate to the remote server |
password |
string: password used to authenticate to the remote server |
output_file |
string: save wget's output messages to this file |
robots_off |
logical: by default wget considers itself to be a robot, and therefore won't recurse into areas of a site that are excluded to robots. This can cause problems with servers that exclude robots (accidentally or deliberately) from parts of their sites containing data that we want to retrieve. Setting |
timestamping |
logical: if |
no_if_modified_since |
logical: applies when retrieving recursively with timestamping (i.e. only downloading files that have changed since last download, which is achieved using |
no_clobber |
logical: if |
no_parent |
logical: if |
no_check_certificate |
logical: if |
relative |
logical: if |
adjust_extension |
logical: if a file of type 'application/xhtml+xml' or 'text/html' is downloaded and the URL does not end with .htm or .html, this option will cause the suffix '.html' to be appended to the local filename. This can be useful when mirroring a remote site that has file URLs that conflict with directories (e.g. http://somewhere.org/this/page which has further content below it, say at http://somewhere.org/this/page/more. If "somewhere.org/this/page" is saved as a file with that name, that name can't also be used as the local directory name in which to store the lower-level content. Setting |
retr_symlinks |
logical: if |
extra_flags |
character: character vector of additional command-line flags to pass to wget |
verbose |
logical: print trace output? |
capture_stdout |
logical: if |
quiet |
logical: if |
debug |
logical: if |
the result of the system call (or if bb_wget("--help")
was called, a message will be issued). The returned object will have components 'status' and (if capture_stdout
was TRUE
) 'stdout' and 'stderr'
bb_install_wget
, bb_find_wget
## Not run:
## get help about wget command line parameters
bb_wget("help")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.