なぜラズパイなのか。。たまたま手元にラズパイがあったから
R言語とは
データ分析に特化してるプログラミング言語。統計解析ができて、解析結果をグラフで表示することができる優れもの!プログラミング言語っていうけど、対話式で、データの保存もイメージを保存する感じになってて
ほかの言語とはちょっと違う印象
インストール
めっちゃ簡単!# apt-getを最新に $ sudo apt-get update # Rをインストール $ sudo apt-get install r-baseとりあえずバージョンを確認しとく
$ R --version R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: arm-unknown-linux-gnueabihf (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under the terms of the GNU General Public License versions 2 or 3. For more information about these matters see http://www.gnu.org/licenses/.
実行してみる
- 起動方法 → 文字の出力
# 実行は「R」 $ R R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: arm-unknown-linux-gnueabihf (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # 起動成功!「>」のマークが出れば入力受付可能 # ひとまず「hello world!」を出力させる > str <- "hello world!" > str [1] "hello world!" # ←できた! >
# 終了コマンド。このあと、セーブするか聞かれる > q() Save workspace image? [y/n/c]: y終了するときセーブするか聞かれる
セーブする際は「s」、しない場合は「n」
セーブすると、「.RData」「.Rhistory」ってファイルができる
このファイルがあるディレクトリで再びRを起動させると続きから始まる
$ ls -la total 16 drwxr-xr-x 2 pi pi 4096 Jun 5 18:43 . drwxr-xr-x 4 pi pi 4096 Jun 5 18:20 .. -rw-r--r-- 1 pi pi 74 Jun 5 18:43 .RData # ←コレ -rw------- 1 pi pi 34 Jun 5 18:43 .Rhistory # ←コレ
0 件のコメント:
コメントを投稿