SQL Query Error

40 views
Skip to first unread message

Peter Gensler

unread,
Jun 9, 2016, 8:24:14 AM6/9/16
to sqldf
Hello SQLDF,

I am trying to write a basic query against the Sample Superstore Dataset (link provided here:
http://kbcdn.tableausoftware.com/data/Superstore.xls )

and my query returns the following error:
https://drive.google.com/open?id=0Bxhxg_yftHNubEc4NUZTUVoxa0E


Below is my code, which is a very simple query.

path <- file.path("/Users/petergensler/Desktop/Sample - Superstore Sales.xls")
superstore <- readWorksheetFromFile(path, sheet= "Orders")

Clearly this should not be returning an error, as that the column which I am querying should be fine with a literal string specified, correct?


test <- sqldf("SELECT * FROM superstore WHERE 'Product Sub-Category' = 'Appliances'")
test

My session info is listed below
> session_info()
Session info -------------------------------------------------------------------------------------------
setting value
version R version 3.3.0 (2016-05-03)
system x86_64, darwin13.4.0
ui RStudio (0.99.896)
language (EN)
collate en_US.UTF-8
tz America/Chicago
date 2016-06-08

I have also attached a screenshot of my installed packages.
https://drive.google.com/open?id=0Bxhxg_yftHNubEc4NUZTUVoxa0E


Obviously this query should not return zero, so is there an issue with my packages installed interfering with sqldf and its dependencies? I am using R on OS X 10.11.5.


Thanks for your help!

Gabor Grothendieck

unread,
Jun 9, 2016, 8:26:12 AM6/9/16
to sqldf
This seems to be a duplicate of a post on stackoverflow.  The comments to the question provide the answer.  See:
Reply all
Reply to author
Forward
0 new messages