View source: R/files_manager.R
upload_file | R Documentation |
Uploads a local file to Google Drive as a plain text document. Will only
upload the file if it doesn't already exist in the chosen location. By
default files are uploaded in the folder "trackdown", if is not available on
Google Drive, permission to create it is required to the user. To update an
already existing file see update_file()
. It is also possible to
upload the output (pdf or html) of the file specifying the path_output
argument. In case of html files, if pagedown
package and Chrome are
available, users can decide to upload a pdf version of the html file.
To know more about trackdown
workflow and features see
trackdown-package()
help page.
upload_file(
file,
gfile = NULL,
gpath = "trackdown",
shared_drive = NULL,
hide_code = FALSE,
path_output = NULL,
rich_text = TRUE,
rich_text_par = NULL,
force = FALSE,
open = rlang::is_interactive()
)
The rich_text
option (default is TRUE
) allows to upload a rich
document to Google Docs. Important text that should not be changed is
highlighted. This includes, added instructions at the top of the document,
placeholders hiding the code, header of the document (YAML header or LaTeX
preamble), code chunks, and in-line code.
Default colour is opaque yellow. You can customize the colour specifying the
rgb_color
option in the rich_text_par
argument. The
rgb_color
has to be a list with elements red
, green
, and blue
.
Each element has to be a numeric value between 0 and 1. See example below.
a dribble of the uploaded file (and output if specified).
## Not run:
# Change default color to opaque light-blue
upload_file(file = "path-to/my-file", rich_text = TRUE,
rich_text_par = list(rgb_color = list(red = 102/255,
green = 204/255,
blue = 255/255)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.