Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 如何在R中阻止大浮点数以指数形式(科学记数法)输出?_Mysql_R_Scientific Notation - Fatal编程技术网

Mysql 如何在R中阻止大浮点数以指数形式(科学记数法)输出?

Mysql 如何在R中阻止大浮点数以指数形式(科学记数法)输出?,mysql,r,scientific-notation,Mysql,R,Scientific Notation,我正在使用诸如“868130240945684480”之类的ID号,它们存储在MySQL数据库中 每当我使用RMySQL进行查询时,输出如下:“8.681302e+17”,然后R将其读取为“868130200000000000”,这是一个完全不同的ID 有没有办法避免这种情况 以下是我为检索数据而进行的查询: require(RMySQL) con <- dbConnect(MySQL(), user='xxx', password='xxx', dbname='xxx', host='x

我正在使用诸如“868130240945684480”之类的ID号,它们存储在MySQL数据库中

每当我使用RMySQL进行查询时,输出如下:“8.681302e+17”,然后R将其读取为“868130200000000000”,这是一个完全不同的ID

有没有办法避免这种情况

以下是我为检索数据而进行的查询:

require(RMySQL)
con <- dbConnect(MySQL(), user='xxx', password='xxx', dbname='xxx', host='xxx')
rs <- dbSendQuery(con, "select sprinklr_twitter.Tweet_Id from sprinklr_twitter
                 inner join twitter
                 on sprinklr_twitter.Tweet_id=twitter.Tweet_id")
Tweet_id<-fetch(rs, n=-1)
Tweet_id<-as.data.frame(Tweet_id)
require(RMySQL)

contry
options(scipen=99)
那么ID MySQL类型是LargeInteger还是什么?MySQL驱动程序注意到ID是一个整数,所以它试图将其解释为整数。在这种情况下,它明显大于R的最大整数(
.Machine$integer.max
),因此它会转换为一个
数字
,很可能会失去准确性。解决这一问题的一种方法是将其作为R中的
字符处理(使用SQL的
转换(…)
);因为我在RMySQL中看不到重写column类的方法,所以您可能必须在SQL中完成所有操作。@YannisP。是的,它在MySQLI中是一个整数。我想您最好接受@r2evans的建议