第一次问题,所以如果我错过了一些东西,我很抱歉:R! posIXCT在sqldf
我导入了一个excel文件到R!使用XLconnect的STR()函数为:
data.frame': 931 obs. of 5 variables:
$ Media : chr "EEM" "EEM" "EEM" "EEM" ...
$ Month : POSIXct, format: "2014-08-01" "2014-08-01" "2014-08-01" "2014-08-01" ...
$ Request_Row : num 8 25 26 37 38 44 53 62 69 83 ...
$ Total_Click : num 12 9 9 8 8 8 7 7 7 7 ...
$ Match_Type : chr "S" "S" "S" "S" ...
当我用下面的sqldf我获得选择的任何行,反正什么是错的:
sqldf(" select Media, sum(Total_Click) , avg(Request_Row), min(Request_Row) , max(Request_Row), count(distinct(Media)) from All_Data
where Request_Row < 100
and month='2014-09-01'
group by 1,2 order by 2,6 desc ")
<0 rows> (or 0-length row.names)
感谢您的帮助
VJ
这个月'2014-09-01'实际上是否存在于excel文件中? – Alex 2014-12-02 00:29:35
并注意'month!= Month'。 (R是区分大小写的,你可能会考虑修复你的问题标题,因为此刻它“只是丑陋”。) – 2014-12-02 00:41:55
听不到答案我会认为拼写是问题,并投票结束为一个简单的错字。 – 2014-12-02 00:58:00