RでSQL選択ステートメントを使用してテーブルからいくつかのデータを抽出しています.
query <- "select * from MyTable where TimeCol='6/29/2012 21:05' ";
result <- fn$sqldf(query);
上記のコードは正しい結果を返しますが、時間値が変数に保存されている場合は機能しません
mytime <- "6/29/2012 21:05";
query <- "select * from MyTable where TimeCol = $mytime"; # OR
query <- "select * from MyTable where TimeCol = $[mytime]"; # OR
query <- "select * from MyTable where TimeCol = '$[mytime]' ";
result <- fn$sqldf(query);
上記の 3 行のいずれも機能していません
View(result)
エラーが発生します:無効な 'x'引数