# Index dataframe in RCall's R macro

**URL:** <https://discourse.julialang.org/t/index-dataframe-in-rcalls-r-macro/16073>\
**Category:** General Usage\
**Created:** [October 9, 2018, 1:27pm UTC](https://discourse.julialang.org/t/index-dataframe-in-rcalls-r-macro/16073 "2018-10-09T13:27:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [October 9, 2018, 1:27pm UTC](https://discourse.julialang.org/t/index-dataframe-in-rcalls-r-macro/16073/1 "2018-10-09T13:27:29Z")

</div>

Hi-

I am wondering if there is a way to index an R dataframe with RCall. I have the following scenario:

R"“”  
#some code  
solve(df$colname)  
“”"  
The problem is that $ is reserved in RCall for denoting a variable.

Thanks!

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [October 9, 2018, 3:09pm UTC](https://discourse.julialang.org/t/index-dataframe-in-rcalls-r-macro/16073/2 "2018-10-09T15:09:59Z")

</div>

In my particular use case, I actually had a list that contained a dataframe. Nonetheless, the same issue with `$` still applied. The solution I came up with was somewhat inelegant, but it might be the only workaround:

`as.data.frame(list[["element"]])`

To access a column of a dataframe in the R macro, the following worked

`df$[["colname"]]`

There might be a more elegant solution, but these work with the R macro.
