0
我從SQLite表讀取data.frame:不能LS(myVector)
sql <- paste("SELECT co_id, co_name, mkt_id FROM co")
co <- dbGetQuery(db, sql)
,並得到有效的結果(似乎):
ls(co)
[1] "co_id" "co_name" "mkt_id"
我則子集的一些數據:
x <- co[ co$mkt_id == 5, 2 ]
x
[1] "Dongbu" "Green" "Hanwha" "Heungkuk" "Hyundai" "LIG"
[7] "Lotte" "Meritz" "Samsung" "KFCC" "NCUF" "NACF"
難以指定此變量x
到gcombobox
,我試圖找到原因和(這是原因或不)發現:
ls(x)
Error in as.environment(pos) : no item called "Dongbu" on the search list
有人可以解釋這是什麼意思? x
不應該是一個普通的向量,而「東部」只是第一個元素?
sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] gWidgetsRGtk2_0.0-81 RSQLite_0.11.2 DBI_0.2-5
[4] stringr_0.6.1 gWidgets_0.0-52 xtable_1.7-0
[7] gridExtra_0.9.1 ggplot2_0.9.2.1
loaded via a namespace (and not attached):
[1] colorspace_1.1-1 dichromat_1.2-4 digest_0.5.2 gtable_0.1.1
[5] labeling_0.1 MASS_7.3-22 memoise_0.1 munsell_0.4
[9] plyr_1.7.1 proto_0.3-9.2 RColorBrewer_1.0-5 reshape2_1.2.1
[13] RGtk2_2.20.25 scales_0.2.2 tools_2.15.2
笨我......-謝謝! – vaettchen