Open gtollefson opened 5 years ago
The first error is because "$x" means string interpolation in Julia, so Julia wants to find a variable with the name of x
to fill into the string.
The second error is that the way the quotation mark is used let Julia think the first x
is outside of the first quotation mark pairs, and it is just before another quotation mark, so Julia will treat it like x"some string"
. This is in fact the string macro in Julia, and Julia will try to find a macro definition like @x_str
.
I think the third error is because of the misuse of [[]]
and []
. In R, x$a
is equivalent to x[['a']]
, which is a single element extraction, but not x['a']
, which is a subset extraction. They can have subtle but important differences when x
is a list or a data.frame.
I think there are some error in the fourth try, because its intention looks different with the first three. In the error information, you can see how RCall is interpreting the command you give.
And there is a small tip I always use, since R doesn't distinguish between pairs of ' and ", you can use ' in your R command to avoid things like \"
.
When I try to run the following line of R code I receive the error I've pasted below.
My reval code works when I exclude the following line which features $ operator extraction. I've tried a few syntax variation for processing in Julia which I've pasted at the very bottom. The code works in the R REPL. I'm using RCall v"0.10.6" on Julia 0.6.3.
h$x$data[[length(h$x$data)]]$marker$colorbar$ticktext <- genotypes
producesI also tried:
produces
h[\"x\"][\"data\"][[length(h[\"x\"][\"data\"])]][\"marker\"][\"colorbar\"][\"ticktext\"] <- genotypes
producesh[[\"x[\"]][[\"]data[\"]][[length(h[[\"]x[\"]][[\"]data[\"]])]][[\"]marker[\"]][[\"]colorbar[\"]][[\"]ticktext[\"]] <- genotypes
produces