marinebon / p2p

Pole to Pole website
https://marinebon.github.io/p2p
3 stars 1 forks source link

csv download links & reticulate `r py$pythonVar` "no py object" #15

Closed 7yl4r closed 10 months ago

7yl4r commented 5 years ago

In an attempt to add a "download this timeseries as .csv` button, I tried accessing variables between R and python as described in the reticulate package docs.

https://github.com/marinebon/p2p/blob/2c09615a09709ffca431a135e4c1ceae9168f6d0/site_template.Rmd#L166-L183

This worked going from R to python using r.csv to get the filepath, but when I tried going from python back to R to "inline code" py$csv_link the build spat out a "object 'py' not found".

The best workaround here is to translate my python string-manipulation into R, but I also want to understand what went wrong. Is this a bug with reticulate? Do inline-code R chunks work differently and cannot access the py object? :man_shrugging: