3

I faced a question,there is a error message to run sqldf package. I just load

install.packages("sqldf")
install.packages("RSQLite")
install.packages("tcltk2")
library("sqldf")
library("RSQLite")
library("tcltk2")

final <-sqldf("select a.age,
                  a.height
           from a
           inner join b
           on
             a.id = b.id
           ")

Error: could not find function "sqldf"

sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] tcltk     stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] tcltk2_1.2-11

loaded via a namespace (and not attached):
[1] tools_3.2.0

Also, my R and Rstudio have latest version. I have Windows 7.

user3849475
  • 267
  • 3
  • 4
  • 12
  • 1
    Just did it in my RStudio - no worries. You must be doing something else wrong. – duffymo Jun 13 '15 at 02:41
  • Are you sure you didn't get any errors with the installing or loading? Can you include in your question what `sessionInfo()` returns just before you call `sqldf`? – MrFlick Jun 13 '15 at 02:48
  • @duffymo I am not sure which part I am wrong.Table a and Table b is in there. – user3849475 Jun 13 '15 at 02:48
  • @duffymo I just revised the post – user3849475 Jun 13 '15 at 03:48
  • What does the console output at the `library(sqldf)` or `library(Rsqlite)` lines? Or on the install.packages lines? Pay attention to unsuccessful messages. – Parfait Jun 13 '15 at 05:11
  • 1
    Your `sessionInfo()` information shows that you are not successfully loading `sqlite`; it should be listed within "other attached packages" if `library(sqldf)` completed successfully. To further confirm things are not being done and/or copied over correctly, when you enter `library(sqldf)` in a new *R* session, it also loads a few other packages (including one that you are loading manually). Please do as @MrFlick and @Pascal suggested: include the *actual and full* text from your calls to (in order) `install.packages`, `library`, `sessionInfo`, and then `sqldf`. – r2evans Jun 13 '15 at 05:33

0 Answers0