简体   繁体   English

如何使用ggplot2可视化tbl_sql数据?

[英]How visualize tbl_sql data using ggplot2?

I'm getting the error, ggplot2 does not know how to deal with data of class tbl_sqlite/tbl_sql/tbl_lazy/tbl . 我收到错误消息, ggplot2 does not know how to deal with data of class tbl_sqlite/tbl_sql/tbl_lazy/tbl Does this mean I need to reduce the size of my data or convert it to another format before I can plot it? 这是否意味着我需要减小数据大小或将其转换为其他格式才能绘制数据?

dplyr holds off on actually collecting the data into r until it is explicitly told to. dplyr推迟将数据实际收集到r中,直到明确告知。 When using dplyr to query a database, be sure to use collect at the end of the chain to pull the query result into r as a data frame. 使用dplyr查询数据库时,请确保在链的末尾使用collect将查询结果作为数据帧拉入r中。

addendum : the dbplot package now provides helper functions to work with dplyr & dbplyr to do some plotting or calculations for intermediate plotting steps in-database 附录dbplot软件包现在提供了辅助功能,可与dplyrdbplyr一起使用以对数据库中的中间绘图步骤进行一些绘图或计算

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM