最新のRStudioバージョンの番号をhttps://www.rstudio.com/products/rstudio/download/
に何らかの形で刻んでダウンロードしてインストールするスクリプトを書くのには苦労しています。最新のRStudioバージョンの取得方法
私はRのプログラマーなので、rvest
パッケージを使用してRスクリプトを作成しました。私はRStudioサーバーのダウンロードリンクを掻き集めることができましたが、まだRStudio自体を入手することはできません。
ここでは、Ubuntu用の64ビットRStudioサーバーのダウンロードリンクを取得するためのRコードを示します。
if(!require('stringr')) install.packages('stringr', Ncpus=8, repos='http://cran.us.r-project.org')
if(!require('rvest')) install.packages('rvest', Ncpus=8, repos='http://cran.us.r-project.org')
xpath<-'//code[(((count(preceding-sibling::*) + 1) = 3) and parent::*)]'
url<-'https://www.rstudio.com/products/rstudio/download-server/'
thepage<-xml2::read_html(url)
the_links_html <- rvest::html_nodes(thepage,xpath=xpath)
the_links <- rvest::html_text(the_links_html)
the_link <- the_links[stringr::str_detect(the_links, '-amd64\\\\.deb')]
the_r_uri<-stringr::str_match(the_link, 'https://.*$')
cat(the_r_uri)
残念ながら、RStudioのデスクトップダウンロードページは完全に異なるレイアウトであり、私はここでも同じアプローチを使用していません。
誰かがこれを手伝ってくれますか?世界のすべてのデータ科学者が手動でRStudioをアップグレードするとは信じられません!
さらに簡単なバージョンのスクリプトがあり、RStudio-serverのバージョンを読み取ります。 Bashのバージョン:
RSTUDIO_LATEST=$(wget --no-check-certificate -qO- https://s3.amazonaws.com/rstudio-server/current.ver)
またはRバージョン:
scan('https://s3.amazonaws.com/rstudio-server/current.ver', what = character(0))
しかしRStudio-デスクトップのバージョンはまだ私を見逃さ。
R Studioは、実行時に更新の有無を確認しませんか? – Spacedman
はい、これは設定可能なオプションですが、ここでは求められていることではありません。 – mdsumner
@mdsumnerはい、しかしRStudioはオープンソースなので、解決策はそこにあります。 – Spacedman