Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经学习了四个小时的 R 编程。当我从 SQL 脚本创建条形图时,条形值全为 1。这是我的步骤:
states =dbGetQuery(con, "SELECT state, COUNT(*) FROM leads GROUP BY state")
当我查看(出)时,它给了我这个:
然后我尝试制作一张桌子:
state.freq <- table(states$state) barplot(state.freq)
我最终得到了这个,基本上都是1??
如下更改您的查询 dbGetQuery(con, "SELECT state FROM Leads") 它应该按预期工作:)