Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple demonstration of the JDataFrame framework used for converting data in Java into JSON which can then be converted into a data frame in the R Project for Statistical Computing using the RJSONIO package.
@Grab('com.coherentlogic.rproject.integration.jdataframe:jdataframe-core:1.0.0-RELEASE')
@Grab('org.slf4j:slf4j-nop:1.8.0-beta4')
import com.coherentlogic.rproject.integration.dataframe.adapters.RemoteAdapter
import com.coherentlogic.rproject.integration.dataframe.domain.JDataFrame
import com.coherentlogic.rproject.integration.dataframe.builders.JDataFrameBuilder
def result = (String) new JDataFrameBuilder<String, Object[]>(
new JDataFrame<String, Object[]>(),
new RemoteAdapter<String, Object[]>()
)
.addColumn("Code", new Object[] {"WV", "VA", })
.addColumn("Description", new Object[] {"West Virginia", "Virginia"})
.serialize()
result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment