看板 R_Language 關於我們 聯絡資訊
[問題類型]: 程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來) [軟體熟悉度]: 入門(寫過其他程式,只是對語法不熟悉) [問題敘述]: 目前公司在伺服器上有裝R,我想要在伺服器上每天固定用R抓GA的資料 我有先做了一個test.R的檔案,可是我在R裡執行test.R都跟我說沒這個檔案 test.R裡的程式碼我有在伺服器上的R跑過,沒問題,但是目前第一步就卡住了 因為RStudio有裝在伺服器上的,一開始我的RGoogleAnalytics是裝在RStudio上 可是發現在終端機上卻找不到,之後我直接在終端機上裝就可以了 想請問一下大家有在終端機上讀R檔或寫R檔的經驗嗎? 謝謝 [程式範例]: [xxxx@xxxxxxx ~]$ ls R test.R test.Rout token > test.R Error: object 'test.R' not found [環境敘述]: R version 3.3.0 (2016-05-03) -- "Supposedly Educational" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-redhat-linux-gnu (64-bit) [關鍵字]: 終端機 伺服器 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 211.23.167.43 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1466996625.A.9CD.html
andy12345638: 在R底下要執行.R的腳本應該使用source("檔案") 06/27 14:58
andy12345638: 若在終端機中執行,使用指令 "Rscript test.R" 06/27 15:00
Wush978: 為了回這篇,寫到最後變成: 06/27 18:27
Wush978: http://wush.ghost.io/r-server-tutorial/ 06/27 18:27
obarisk: 純推wush 06/27 22:14
maninblue: 版主認真~ 06/27 22:15
obarisk: 我是用#!/usr/bin/Rscript 06/27 22:16
JackBaska: 版主太認真了,之前在Cluster上跑弄了老半天 06/28 07:58
jklkj: ng_google_analytics_data_with_r/ 06/28 09:39
jklkj: 讓我想到上面那篇有人說any time you see "hadley" write 06/28 09:40
jklkj: something, treat it as the voice of God 06/28 09:40
jklkj: any time you see "Wush978" write something, treat it as 06/28 09:41
jklkj: the voice of God 06/28 09:41
jklkj: 除了在看伺服器這篇外我也在研究JDBC那篇,非常感謝 06/28 09:43