简体   繁体   English

如何在MongoDB中存储.RData文件

[英]How can I store .RData file in MongoDB

I built Logistic regression model using RStudio, the result is store as log_lr.RData, so i want to store this result (object) in MongoDB. 我使用RStudio构建了Logistic回归模型,结果存储为log_lr.RData,因此我想将此结果(对象)存储在MongoDB中。

Have you one idea to help me ? 有什么办法可以帮助我吗?

Thanks 谢谢

You can save or saveRDS to a rawConnection to put your data to a raw variable in R, then use the mongolite package to get it into MongoDB as binary data. 您可以save saveRDS savesaveRDSrawConnection以将数据放入R中的原始变量,然后使用mongolite包将其作为二进制数据放入MongoDB。

x <- 1:10
con <- rawConnection(raw(0), open = "r+")
save(x, file=con)
mydata <- rawConnectionValue(con)

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

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