In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Error in as.data.frame.default | Cannot coerce class to a data.frame

rahulchauhan
7 - Meteor

Hi,

 

I'm trying to read a dataframe in the R tool but I keep on getting the below error message. I've also included the code that I'm trying to run.

 

This code runs perfectly in R Studio, I'm unable to understand what's the issue in Alteryx.

 

 Error that I'm gettingError that I'm gettingCode that I'm trying to runCode that I'm trying to run

1 REPLY 1
AndrewKramer
Alteryx Alumni (Retired)

This error is related to writing your data back into Alteryx. Alteryx requires the data to be in a data frame in order for the writeback to work. If it's not a data frame, Alteryx will use the function as.data.frame to try to coerce the data into a data frame. This is where you are getting the error, as R cannot natively convert a corpus to a data frame.

 

I would recommend continuing on with your text mining analysis, and then output final results, such as topics or document-term-matrices, into Alteryx.

 

This Stackoverflow link provides a few suggestions to coerce your corpus into a data frame:

https://stackoverflow.com/questions/24703920/r-tm-package-vcorpus-error-in-converting-corpus-to-data...

 

Labels
Top Solution Authors