我正在处理数千个气象时间序列数据(样本数据可以从这里下载) https://dl.dropboxusercontent.com/s/bxioonfzqa4np6y/timeSeries.txt
在我的Linux Mint PC(64位,8GB RAM,双核2.6 GHz)上使用ggplot2绘制这些数据耗费了大量时间.我想知道是否有办法加快速度或更好地绘制这些数据?非常感谢您的任何建议!
这是我现在使用的代码
##############################################################################
#### load required libraries
library(RCurl)
library(dplyr)
library(reshape2)
library(ggplot2)
##############################################################################
#### Read data from URL
dataURL = "https://dl.dropboxusercontent.com/s/bxioonfzqa4np6y/timeSeries.txt"
tmp <- getURL(dataURL)
df <- tbl_df(read.table(text = tmp, header=TRUE))
df
##############################################################################
#### Plot time series using ggplot2
# Melt the data by date first
df_melt <- melt(df, id="date")
str(df_melt)
df_plot <- ggplot(data = df_melt, aes(x = date, y = value, color = variable)) +
geom_point() +
scale_colour_discrete("Station #") +
xlab("Date") +
ylab("Daily Precipitation [mm]") …
Run Code Online (Sandbox Code Playgroud) 我的代码在这里可用,因为当我试图在这里发布时,Stack Overflow一直给我错误.
我的错误如下:
Traceback (most recent call last):
File "/tmp/DoubleIntegrate.py", line 30, in <module>
t = interpolate.UnivariateSpline(d1.values(), d2.values())
File "/Library/Python/2.7/site-packages/scipy-0.11.0.dev_1983db6_20120208-py2.7-macosx-10.7-x86_64.egg/scipy/interpolate/fitpack2.py", line 136, in __init__
xb=bbox[0],xe=bbox[1],s=s)
dfitpack.error: (m>k) failed for hidden m: fpcurf0:m=1
Run Code Online (Sandbox Code Playgroud)
我梳理了源代码并且无法从它的尾部开始.
这个错误是什么意思?
我有一个表存储某些表的名称 - tableNames.我想在其中一些表上运行DELETE语句(删除它们所代表的表中的所有行,而不是从tableNames中删除它们).我以为我可以做到
DELETE FROM (SELECT tableName FROM tablesNames WHERE ...) AS deleteTables
Run Code Online (Sandbox Code Playgroud)
但我不断收到错误的语法错误.我还想过迭代WHILE循环中的表并使用变量存储,但我希望有更简单的方法.具体来说,这适用于Microsoft SQL
ggplot2 ×1
performance ×1
python ×1
r ×1
rcurl ×1
scipy ×1
sql ×1
sql-server ×1
t-sql ×1
time-series ×1