我从一个 sqlite 表中读取了一个 data.frame:
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
给 a时遇到困难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