以下の3つの関数でこと足りる気がするのでまとめておく
drive_find
について
- ディレクトリやファイルの検索関数
- 検索対象の 名前 と ID を取得可能
- 検索範囲を拡張子やタイプで
type
で指定可能document
: Google Docspresentation
: Google Slidesspreadsheet
: Google Sheetsfolder
: フォルダcsv
xlsx
pdf
etc : 拡張子
- 表示件数を
n_max
で指定可能(デフォルトは全件検索)
drive_find(pattern = '{オブジェクト名}', n_max = 50) drive_find(type = 'folder', n_max = 50)
drive_ls
について
drive_ls(path = '{ディレクトリ名}') drive_ls(path = as_id('{ID}')) drive_ls(path = '{ディレクトリ名}', recursive = T) drive_ls(path = as_id('{ID}'), recursive = T) drive_ls(path = '{ディレクトリ名/子ディレクトリ名}')
drive_download
について
- ファイルのダウンロード関数
- ダウンロード対象はファイルの名前やIDを
file
に入力して指定 - ファイルの形式と保存先は
path
で指定可能
drive_download(file = '{ファイル名}') drive_download(file = as_id('{ID}')) drive_download(file = '{ファイル名}', path = '{DLしたファイルの保存先/hogehoge.csv}')