[問題] plot出date-time資料整理
[目的]--------------------------------------------
在ubuntu 環境上取用Mysql資料
並使用shiny server 去plot呈現折線圖
(之所以會用plot是因為shiny server無法library(ggplot2))
[問題]--------------------------------------------
我從mysql取得的資料
如下url:
http://140.128.197.58:3838/sample-apps/rmysql2/
的下面的表格
plot-xy圖中
x軸是time
y軸是PM2.5
該資料有兩個欄位都是時間
不知可否吧
Date和time 合拼
或不用合拼,只要讓x是照時間順序plot出pm2.5就行
[code]--------------------------------------------
以下是在server.R的code,用shiny 執行
library(DBI)
library(RMySQL)
conn <- dbConnect(MySQL(), host="localhost", dbname="Airbox",
username = "root", password = "[password]")
#成功連上數據庫
ES = dbGetQuery(conn, "select * from data_school where site='ES'")
plot(ES$time, ES$PM2.5, type="l")
[錯訊訊息]--------------------------------------------
(chrom訊息)
Error:An error has occurred. Check your logs or contact the app
suthor for clarification.
(按F12 Console)
Wed Jan 04 2017 01:31:16 GMT+0800 (台北標準時間)
[DBG]: 3 message(s) discarded from buffer
希望大神,有什麼方法可整理資料??
@@
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.128.101.143
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1483464878.A.63F.html
→
01/06 09:29, , 1F
01/06 09:29, 1F
→
01/06 09:31, , 2F
01/06 09:31, 2F
→
01/06 09:32, , 3F
01/06 09:32, 3F
→
01/11 15:19, , 4F
01/11 15:19, 4F
→
01/11 15:25, , 5F
01/11 15:25, 5F
→
01/11 15:25, , 6F
01/11 15:25, 6F
→
01/11 15:26, , 7F
01/11 15:26, 7F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章