gpt4 book ai didi

r - sqldf 找不到数据,错误为 "no such table"

转载 作者:行者123 更新时间:2023-12-04 12:32:17 25 4
gpt4 key购买 nike

直到现在,当我收到以下错误时,我一直在我的 R 脚本中使用 sqldf:

library(sqldf)
data(mtcars)
out <- sqldf("SELECT * FROM mtcars")

> Error in rsqlite_send_query(conn@ptr, statement) : no such table: mtcars

以前没有这个问题,有谁知道是什么问题吗?

最佳答案

我在 CRAN (Windows 10) 的 0.4-10 上遇到了这个问题。

> out <- sqldf("SELECT * FROM mtcars")
Loading required package: tcltk
Error in rsqlite_send_query(conn@ptr, statement) : no such table: mtcars

然后我从 GitHub 升级,版本 0.4-11
> devtools::install_github("ggrothendieck/sqldf")
Downloading GitHub repo ggrothendieck/sqldf@master
from URL https://api.github.com/repos/ggrothendieck/sqldf/zipball/master
Installing sqldf
Installing 1 package: DBI
Installing package into ‘C:/Users/romunov/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/DBI_0.7.zip'
Content type 'application/zip' length 746913 bytes (729 KB)
downloaded 729 KB

package ‘DBI’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\romunov\AppData\Local\Temp\Rtmp6vYjwO\downloaded_packages
"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" --no-site-file --no-environ \
--no-save --no-restore --quiet CMD INSTALL \
"C:/Users/romunov/AppData/Local/Temp/Rtmp6vYjwO/devtoolsdb05f0015fc/ggrothendieck-sqldf-af1277f" \
--library="C:/Users/romunov/Documents/R/win-library/3.3" \
--install-tests

* installing *source* package 'sqldf' ...
** R
** demo
** inst
** tests
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (sqldf)
Reloading installed sqldf
> sqldf("SELECT * FROM mtcars LIMIT 6")
mpg cyl disp hp drat wt qsec vs am gear carb
1 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
2 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
3 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
4 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
5 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
6 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1

查看来自 GitHub 的最后两次提交,对 sqldf 没有进行实质性更改。包裹。 DBI不过,确实升级到了 0.7,这可能已经解决了问题。 Gabor 可能会提供细节。

关于r - sqldf 找不到数据,错误为 "no such table",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44755802/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com