2017-08-22 4 views
0

RオブジェクトをDropboxにアップロードするパッケージ(rDrop)があることは知っています。ローカルDropboxディレクトリなしで非RオブジェクトをDropboxにアップロード

私は、スタンダードを使用して、クリーンなHTMLテーブルで回帰を統合しています。

これらをDropboxにもアップロードする方法はありますか? Rオブジェクトではないのですか?または、作業ディレクトリを定義することによって、ジョブを完了させるための回避策がありますか?

私が直面している主な問題は、私がクラウドインスタンスから作業しており、そこにDropboxをインストールできないということです。だから私はローカルDropboxディレクトリを持たずにDropboxにアップロードする方法を探している。

答えて

1

rDrop2パッケージを使用すると、任意のファイルをDropboxにアップロードできます。これはDropboxサービス用のAPIラッパーです。

以下

あなたはパッケージを使用して自分のマシン上で認証されると動作するはずいくつかの擬似コードである:以下

#load your data 
data(iris) 

#build your model 
mod <- lm(Petal.Width ~ Sepal.Length + Sepal.Width, data=iris) 

#save your html 
table_html <- stargazer::stargazer(mod, type = "html") 

#write html to disk 
write(x = table_html, file = "html_regression.html") 

#get most recent version of the rdrop2 package 
#not, the package is based on the v1 API which will soon cease to 
#function 
install.packages("rdrop2") 

#load library and authenticate 
library(rdrop2) 
drop_auth() 

#check directory exists 
drop_dir("stargazer_regressions") 

#upload your html to dropbox 
drop_upload("html_regression.html", dest = "stargazer_regressions") 

最終的な出力:

enter image description here

+0

これは本当に、ありがとうございました偉大で簡単な解決策!現在のAPIインターフェイスが機能しなくなると、類似のソリューションが存在するかどうかを知っていますか? – deca

+0

rdrop2パッケージがアップグレードされていない場合は、新しいv2 apiエンドポイントを指すように必要な機能を更新するだけで済みます。 – Greg

関連する問題