upload_file {trackdown}R Documentation

Upload file to Google Drive for collaborative writing and editing

Description

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.

Usage

upload_file(
  file,
  gfile = NULL,
  gpath = "trackdown",
  shared_drive = NULL,
  hide_code = FALSE,
  path_output = NULL
)

Arguments

file

character. The path of a local '.Rmd' or '.Rnw' file.

gfile

character. The name of a Google Drive file (defaults to local file name).

gpath

character. (Sub)directory in My Drive or a shared drive (optional). By default files are uploaded in the folder "trackdown". To specify another folder the full path is required (e.g., "trackdown/my_folder"). Use NULL to upload directly at the root level, although it is not recommended.

shared_drive

character. The name of a Google Drive shared drive (optional).

hide_code

logical value indicating whether to remove code from the text document (chunks and header). Placeholders of type "[[chunk-<name>]]" are displayed instead.

path_output

default NULL, specify the path to the output to upload together with the other file. PDF are directly uploaded, HTML can be first converted into PDF if package pagedown and Chrome are available.

Value

a dribble of the uploaded file (and output if specified)


[Package trackdown version 1.1.1 Index]