# Shout out to JuliaConnectoR and DataFrames.jl / Tables.jl

**URL:** https://discourse.julialang.org/t/shout-out-to-juliaconnector-and-dataframes-jl-tables-jl/80090
**Category:** Offtopic
**Tags:** appreciation
**Created:** [April 26, 2022, 8:01pm UTC](https://discourse.julialang.org/t/shout-out-to-juliaconnector-and-dataframes-jl-tables-jl/80090 "2022-04-26T20:01:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RobertGregg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robertgregg/32/22105_2.png) [@RobertGregg](https://discourse.julialang.org/u/RobertGregg)
#### Post date: [April 26, 2022, 8:01pm UTC](https://discourse.julialang.org/t/shout-out-to-juliaconnector-and-dataframes-jl-tables-jl/80090/1 "2022-04-26T20:01:08Z")

</div>

I’m impressed at how smoothly these two packages worked together for me just now!

I was creating a Julia to R interface for a [little package](https://github.com/RobertGregg/FGES.jl) I’m developing and noticed that the JuliaConnectoR package could directly translate julia tables to R dataframes with the `as.data.frame()` function.

Awesome, one problem: the data I wanted to send over was currently a `Vector{myStruct}` object. I thought it was going to take a long time to convert this to a DataFrame but [this post](https://discourse.julialang.org/t/struggling-to-implement-tables-jl-interface-for-vector-mystruct/42318/7) shows that you literally just have to pass the object to `DataFame` (?!).

So in one line of julia code and one line of R code I was able to (1) convert a custom datatype collection to a dataframe, (2) migrate the data into a different language, and (3) convert that data into a native data type independent of julia. 🤯

Here are the two lines in case anyone was curious:

```julia
#Julia
#Takes in a partially directed acyclic graph (PDAG)
#edges() creates an iterator over all the edges in the graph 
#DataFrame converts the edge iterator into a table

edgetable(g::PDAG) = DataFrame(edges(g))

```

FGES is the name of the package and g is an instance of the PDAG:

```julia
#R
#Convert the edge list to an R dataframe
df <- as.data.frame(FGES$edgetable(g))

```
