Index dataframe in RCall's R macro

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!

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.