mstellwa / rfml

MarkLogic NoSQL Enterprise database server in-database analytics for R
5 stars 2 forks source link

Loading data fails on R shiny server #35

Open hugokoopmans opened 7 years ago

hugokoopmans commented 7 years ago

Hi,

I have a very strange issue,

Error in as.data.frame.default: cannot coerce class "structure("ml.data.frame", package = "rfml")" to a data.frame

Rmd:


title: "Report" author: "hugo" date: "12/21/2016" output: html_document

knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)

Introduction

Sensing Clues project. We are testing two trespasser sensors in the field.

library(rfml)
#create a connection
localConn <- ml.connect("example.com","xxx","xxx", "xxx")
# create a ml.data.frame
mlSources <- ml.data.frame(localConn, collection = "source")
#head(mlSources)

# download from db server
df.sources <- as.data.frame(mlSources)

R Shiny log:

processing file: index.Rmd Quitting from lines 23-30 (index.Rmd) Warning: Error in as.data.frame.default: cannot coerce class "structure("ml.data.frame", package = "rfml")" to a data.frame Stack trace (innermost first): 117: as.data.frame.default 116: as.data.frame 115: eval 114: eval 113: withVisible 112: withCallingHandlers 111: handle 110: timing_fn 109: evaluate_call 108: evaluate::evaluate 107: evaluate 106: in_dir 105: block_exec 104: call_block 103: process_group.block 102: process_group 101: withCallingHandlers 100: process_file 99: knitr::knit 98: 97: do.call 96: contextFunc 95: .getReactiveEnvironment()$runWith 94: shiny::maskReactiveContext 93: 82: doc 81: shiny::renderUI 80: func 79: origRenderFunc 78: output$reactivedoc 3: 2: do.call 1: rmarkdown::run

mstellwa commented 7 years ago

It is something with some environments. You can get a similar error using the testthat package as well. I have not figured out what it is that is causing it.

Also, are you using the CRAN version or the latest dev version?